4

WidthRequest=50 in Windows phone project not working. In android and iOS it is working. But in WinPhone displaying only half button. I tried with MinimumWidthRequest also, that also not working.

Button takes MinimumWidth of only 109 in windows phone. Less than 109 WIdthRequest, disappears overflowed width. Does anybody knows how to modify this MinimumWidthRequest in WinPhone? or Any other solution for this?

<StackLayout VerticalOptions="Center" HorizontalOptions="Center">
    <Label Text="WidthRequest=109" HorizontalTextAlignment="Center" Margin="0,10,0,0"/>
    <Button HorizontalOptions="Center" VerticalOptions="Center" Text="109" HeightRequest="50" WidthRequest="109"/>
    <Label Text="WidthRequest=108"  HorizontalTextAlignment="Center" Margin="0,10,0,0"/>
    <Button HorizontalOptions="Center" VerticalOptions="Center" Text="108" HeightRequest="50" WidthRequest="108"/>
    <Label Text="WidthRequest=70"  HorizontalTextAlignment="Center" Margin="0,10,0,0"/>
    <Button HorizontalOptions="Center" VerticalOptions="Center" Text="70" HeightRequest="50" WidthRequest="70"/>
    <Label Text="WidthRequest=50" HorizontalTextAlignment="Center" Margin="0,10,0,0"/>
    <Button HorizontalOptions="Center" VerticalOptions="Center" Text="50" HeightRequest="50" WidthRequest="50"/>
</StackLayout>

This is how Button displays in Windows Phone

This is how Button displays in Android

  • Please read [ask], especially the part about including a [mcve] in your question. – Nic Mar 27 '17 at 04:48

1 Answers1

4

Finally solved the problem, Created CustomRender of Button and defined Control.MinWidth for Button. MinimumWidthRequest not working as expected in Xamarin.Forms.