alexrainman / SegmentedControl

MIT License
86 stars 38 forks source link

When the Value_Changed called the text in the segment is align to vertical in android. #99

Open Sahithi-Snovasys opened 5 years ago

Sahithi-Snovasys commented 5 years ago

I am using this plugin for both iOS and Android. I am facing a strang issue for Android. Initially the text on the segments is properly aligned but Value_Changed event is fired the text on the segment is aligning to the vertical.

Here is my code:

 <segmentedcontrols:SegmentedControl ValueChanged="SegControl_ValueChanged" x:Name="SegControl" HorizontalOptions="FillAndExpand" TintColor="#0d2241" SelectedSegment="0" BackgroundColor="White">
                            <segmentedcontrols:SegmentedControl.Children>
                                <segmentedcontrols:SegmentedControlOption VerticalOptions="CenterAndExpand" Text="Test" />
                                <segmentedcontrols:SegmentedControlOption VerticalOptions="CenterAndExpand" Text="Sample" />

                            </segmentedcontrols:SegmentedControl.Children>
                        </segmentedcontrols:SegmentedControl>

public async void Handle_ValueChanged(object o, int e)
 {
 switch (e)
 {
 case 0:
 MainPageContainer.Children.Clear();
 MainPageContainer.Children.Add(TestView);
 
 

 break;
 case 1:
 MainPageContainer.Children.Clear();
 MainPageContainer.Children.Add(SampleView);
 
 break;
 }
 } I dont have any such issues for iOS.

Here is how Iam facing the issue

Screen Shot 2019-04-04 at 07 19 24 Screen Shot 2019-04-04 at 07 19 34

How to resolve this?

titolim commented 5 years ago

I cannot reproduce. Can you upload your project?

AshwiniShetty16 commented 4 years ago

Even I am facing alignment issue. Please find the screenshot here below. when delete view is present at the top of screen, the alignment is changing from center to left when handle is changed. Any solution ?

Screenshot 2020-09-10 at 3 41 54 PM