@@ -41,7 +41,7 @@ public partial class RadioButton : StatefulStackLayout
4141 internal Grid IconLayout ;
4242 internal IconView iconCircle = new IconView { Source = ImageSource . FromResource ( RESOURCE_CIRCLE ) , FillColor = GlobalSetting . BorderColor , VerticalOptions = LayoutOptions . CenterAndExpand , HorizontalOptions = LayoutOptions . Center , HeightRequest = GlobalSetting . Size , WidthRequest = GlobalSetting . Size } ;
4343 internal IconView iconChecked = new IconView { Source = ImageSource . FromResource ( RESOURCE_DOT ) , FillColor = GlobalSetting . Color , IsVisible = false , VerticalOptions = LayoutOptions . CenterAndExpand , HorizontalOptions = LayoutOptions . Center , HeightRequest = GlobalSetting . Size , WidthRequest = GlobalSetting . Size } ;
44- internal Label lblText = new Label { IsVisible = false , VerticalTextAlignment = TextAlignment . Center , VerticalOptions = LayoutOptions . CenterAndExpand , TextColor = GlobalSetting . TextColor , FontSize = GlobalSetting . FontSize , FontFamily = GlobalSetting . FontFamily } ;
44+ internal Label lblText = new Label { VerticalTextAlignment = TextAlignment . Center , VerticalOptions = LayoutOptions . CenterAndExpand , HorizontalOptions = LayoutOptions . Fill , TextColor = GlobalSetting . TextColor , FontSize = GlobalSetting . FontSize , FontFamily = GlobalSetting . FontFamily , MaxLines = 3 , LineBreakMode = LineBreakMode . WordWrap } ;
4545 private bool _isDisabled ;
4646 #endregion
4747
@@ -52,23 +52,26 @@ public partial class RadioButton : StatefulStackLayout
5252 public RadioButton ( )
5353 {
5454 InitVisualStates ( ) ;
55- ApplyIsCheckedAction = ApplyIsChecked ;
56- ApplyIsPressedAction = ApplyIsPressed ;
55+
56+ Orientation = StackOrientation . Horizontal ;
5757 if ( Device . RuntimePlatform != Device . iOS )
5858 lblText . FontSize = lblText . FontSize *= 1.5 ;
5959
60- Orientation = StackOrientation . Horizontal ;
60+
61+ ApplyIsCheckedAction = ApplyIsChecked ;
62+ ApplyIsPressedAction = ApplyIsPressed ;
6163
6264 IconLayout = new Grid
6365 {
64- VerticalOptions = LayoutOptions . CenterAndExpand ,
66+ VerticalOptions = LayoutOptions . Center ,
6567 Children =
6668 {
6769 iconCircle ,
6870 iconChecked
6971 } ,
7072 MinimumWidthRequest = GlobalSetting . Size * 1.66 ,
7173 } ;
74+
7275 ApplyLabelPosition ( LabelPosition ) ;
7376
7477 GestureRecognizers . Add ( new TapGestureRecognizer { Command = new Command ( Tapped ) } ) ;
@@ -217,13 +220,13 @@ private void ApplyLabelPosition(LabelPosition position)
217220 Children . Clear ( ) ;
218221 if ( position == LabelPosition . After )
219222 {
220- lblText . HorizontalOptions = LayoutOptions . Start ;
223+ IconLayout . HorizontalOptions = LayoutOptions . Center ;
221224 Children . Add ( IconLayout ) ;
222225 Children . Add ( lblText ) ;
223226 }
224227 else
225228 {
226- lblText . HorizontalOptions = LayoutOptions . StartAndExpand ;
229+ IconLayout . HorizontalOptions = LayoutOptions . Center ;
227230 Children . Add ( lblText ) ;
228231 Children . Add ( IconLayout ) ;
229232 }
@@ -273,10 +276,12 @@ public virtual void ApplyIsChecked(bool isChecked)
273276 Checked ? . Invoke ( this , null ) ;
274277 }
275278 }
279+
276280 public virtual async void ApplyIsPressed ( bool isPressed )
277281 {
278- await iconCircle . ScaleTo ( isPressed ? .5 : 1 , 100 ) ;
282+ await IconLayout . ScaleTo ( isPressed ? .8 : 1 , 100 ) ;
279283 }
284+
280285 void InitVisualStates ( )
281286 {
282287 VisualStateManager . SetVisualStateGroups ( this , new VisualStateGroupList
0 commit comments