Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我将 UIButton 的文本更改为一个长等式。不幸的是,我的文字被缩短了。
如何防止缩短?即使我在 Nib 中指定“剪辑”或“自动换行”,它也会缩短我的文本。
调用这两个方法,您的按钮将自动调整为文本的大小:
[myButton sizeToFit]; [mybutton setNeedsDisplay];