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 sizeToFit] 确实适用于 IOS 6。但它不适用于 IOS7。所以我想知道如何在 IOS 7 中通过文本自动调整 UIButton 的大小。我在互联网上搜索但没有找到正确的答案。任何提示将不胜感激。
你可以这样做[yourButton.titleLabel sizeToFit];
[yourButton.titleLabel sizeToFit];