Zoom button for Xamarin Forms text

Is there a way to scale the button for text, or align the text to the left? I have created a static method that allows me to set a common theme for my buttons. I know you can use LayoutOptions.Start to move the button to the left of the page.

public static void DefaultButtonTheme(Button button)
{ 
    //previous code
    .
    .
    button.HorizontalOptions = LayoutOptions.Start;
}

      

However, for text less than a certain number of letters, this is the center of the button.

See the image below.

enter image description here

+3


source to share


1 answer


I did a little research on this behavior, and found that this error appears on Android, but not on UWP. I also tried using MinimumWidthRequest="0"

with no result.

Since Anto Maniscarco said you should create your own control and then overwrite the android rendering with android:minHeight="0dp"

, as you can see in the following link . It seems Google has decided on a default minimum size for this control.



Hope this helps you.

+1


source







All Articles