如何将标签更改为布局,与在Xamarin Forms上显示通知相同?

时间:2018-12-24 07:25:51

标签: c# xamarin xamarin.forms xamarin.ios xamarin.android

我在屏幕上显示label,但是label的字符串太长,它隐藏了我的屏幕的一部分。我想自定义或替换label进行布局,使其布局与Local Notificationshttps://docs.microsoft.com/en-us/xamarin/android/app-fundamentals/notifications/local-notifications#expanded-layouts)相同

Local Notifications

如何使用“ long string”将short string折叠为...

我正在使用Xamarin Forms 3.4版。

请帮助我!谢谢!

1 个答案:

答案 0 :(得分:0)

您可以像这样使用Label的LineBreakMode属性。

var lblDetail = new Label
    {
        LineBreakMode = LineBreakMode.TailTruncation,
        Text = "a really long string that should show 2 lines then ..."
    };
相关问题