2017-04-14 16 views
0

我将三行字符串标题设置为UIButton。我正在使用iOS 10,但我无法设置它。在iOS 10中使用三行​​文本的按钮Xamarin

我试过了。

  1. 用下面的字符串设置UIButton标题标签。

    String = "Before\n-\n12:00"

\n不会将字符串拆分为新行。

并且还将UIButton属性设置为WordWrap

  • 当我设置

    noOfLine到的UIButtonTitleLabel但noOfLine属性是not display

  • 截图:

    enter image description here

    见截图:

    First one is UIButton但我接受它不显示良好。

    Second one is UILabel这是显示出我所期望的。

    我想设置它像第二个。

    有什么办法像第二个一样设置它。

    任何帮助被赞赏。

    +0

    plz使用setAttributedTitle放置UIButton的setTitle方法。 –

    回答

    0

    一个解决方案是,我发现下面

    见截图:

    enter image description here

    在UIButton的设置TitleAttributed 还设置Titlecentre

    输出如预期。

    相关问题