[英]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?有什么办法可以在 Xamarin.Forms 中设置我的 Label 的样式以在行中扩展到它真正需要的空间(甚至超出屏幕宽度)然后显示
To explain it better, here is the picture of two situations:为了更好地解释它,这里是两种情况的图片:
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 "AB C DEFGHIJKLMNOPQ R STUVWXYZ".
两个标签都将 Text 属性设置为“AB C DEFGHIJKLMNOPQ R STUVWXYZ”。
Label in blue box is pretty easy and standard to achieve.蓝盒中的 Label 非常容易实现并且是标准的。
My concerns is regarding the Label in red box.我担心的是红框中的 Label。 Can this be done through XAML or need some code-behind calculations and setting?
这可以通过 XAML 完成还是需要一些代码隐藏计算和设置?
use the LineBreakMode property使用LineBreakMode属性
<Label LineBreakMode="HeadTruncation" ... />
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.