uilabel 左上对齐,如何为iOS应用程序设置UILabel的左上角对齐方式?

I have added one label in my nib file, then its required to have top-left alignment for that lable. As I am providing text at runtime so its not sure that how much lines there are.

So if text contains only single line then it appears as vertical-center aligned. That alignment is not matching with my respective lable in front of it.

For example:

537aae89df75564e80aa89b008aaf050.png

Which is looking odd :(

Is there any way where i can set label text proper to Top-Left alignment?

解决方案

Rather than re-explaining, I will link to this rather extensive & highly rated question/answer:

The short answer is no, Apple didn't make this easy, but it is possible by changing the frame size.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值