简体   繁体   中英

iPhone — getting the adjusted font size of a UITextField

I have a UITextField with the adjustsFontSizeToFitWidth property set to YES. I want to get ahold of the current (adjusted) font size. Is that possible?

If not, getting ahold of the actual width of the text (in the adjusted size) would be almost as good.

在调整后的大小中,文本的宽度将与文本字段的宽度相同。

我不认为这是可能的,但编写自己的课程应该不会太难。

Here's a small snippet/extension I wrote down to handle this.

http://swiftstub.com/134886004/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM