krs
krs

Reputation: 599

How can I show end of Label in Xamarin.Forms?

Is there any way how can style my Label in Xamarin.Forms to expand in row to the space it really needs (even beyond screens width) and then show the end of it?

To explain it better, here is the picture of two situations:

screen with two Label controls

Let's asume that black box are the screen bounds. Blue and red boxes are Label's bounds. Both Labels has set Text property to "A B C D E F G H I J K L M N O P Q R S T U V W X Y Z".

Label in blue box is pretty easy and standard to achieve.

My concerns is regarding the Label in red box. Can this be done through XAML or need some code-behind calculations and setting?

Upvotes: 1

Views: 393

Answers (1)

Jason
Jason

Reputation: 89102

use the LineBreakMode property

<Label LineBreakMode="HeadTruncation" ... />

Upvotes: 1

Related Questions