Closed julesx closed 7 years ago
I just made the Android version behaves exactly like ios where unselected tabs are transparent a selected one text is transparent also.
I understand your point now. Thanks
just to add, i think you should consider making the Tint color be the Accent color by default, it looks much better than the default color being used right now (which i believe is the default radio button colors)
I am using TintColor. I dont know what you mean by accent.
https://developer.xamarin.com/guides/xamarin-forms/working-with/colors/
Color.Accent Color.Default
these are named colors that are defined by the android OS theme. Currently I am doing this
<abstractions:SegmentedControl.TintColor>
<OnPlatform x:TypeArguments="Color">
<OnPlatform.iOS>
#007AFF
</OnPlatform.iOS>
<OnPlatform.Android>
Accent
</OnPlatform.Android>
</OnPlatform>
</abstractions:SegmentedControl.TintColor>
I still dont understand what you want :). I am using TintColor in unselected tabs text color, borders and selected tan background. Exactly as iOS component.
set the Tint color to Accent
as the default color.
@julesx I agree we need an additional property for unselected background color and maybe for text color (selected normal).
For instance: http://prntscr.com/diq6y7
Looking for work around to make the unselected items background transparent and text color black.
I am using TintColor in unselected tabs text color, borders and selected tab background. Exactly as iOS component and that wont change. I am adding a property to set selected tab text color, normally to provide the hability to match container background color, as transparent doesnt works.
UISegmentedControl uses TintColor for selected segment background color, unselected segments text color and border color. I am matching that.
If you set the text colour to Color.Default it should be visible both selected and not. A property certainly wouldn't hurt though.
As i said, Android control is intent to mimic iOS counterpart and that's the way it should be.
If you set the background color (to white for instance), it colors outside the border of the control. It means if I want white buttons with blue selected button and blue borders, there is white drawn outside the button itself.
<segControl:SegmentedControl x:Name="YearSplitButton"
TintColor="Blue"
BackgroundColor="White"
SelectedTextColor="White"
SelectedSegment="0" Grid.Row="0" Grid.ColumnSpan="3" HeightRequest="30" Margin="0,10,0,10">
<segControl:SegmentedControl.Children>
<segControl:SegmentedControlOption Text="2016" />
<segControl:SegmentedControlOption Text="2017" />
<segControl:SegmentedControlOption Text="2018" />
</segControl:SegmentedControl.Children>
</segControl:SegmentedControl>
https://github.com/alexrainman/SegmentedControl/blob/master/SegmentedControl/SegmentedControl.FormsPlugin.Android/SegmentedControlImplementation.cs#L100
i believe this should be
v.SetTextColor(Color.FromHex("#00ffffff").ToAndroid());