Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Auto Size font for button text to fit in single line

$
0
0

Hello All,

I have a problem and kind of stuck on this.
I had 5 buttons which display at the bottom of the screen. (Android & ios)
The default font size is 14. I want to calculate the font size of all 5 buttons text to check they fit the screen size or not.
If they don't fit with the width of the screen then reduce the font size to 12 and try to display. If it still doesn't fit truncates the button text length and display with font size 14.

Button sets are in Grid and I have a button renderer which is using Control.TitleLabel.LineBreakMode = UILineBreakMode.WordWrap;
I can't change this wordwrap here because this renderer is been used in many places where text wrap is required.

This is another scenario where only 3 buttons are available and 2nd button still wraps in 2 lines.

Thank you


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>