iPhone:如何通过针对 iPad 应用程序自动调整标签字体大小来更改标签字体大小?
我想将 iPhone 应用程序转换为 iPad 应用程序
为此,我正在自动调整控件的大小,对于按钮,它工作得很好。
当我自动调整标签大小时,问题就出现了,标签的位置相对变化,但标签的字体大小保持不变。
如何通过自动调整标签大小来增加标签大小(即标签的字体大小)?
请帮助&建议
谢谢。
I want to convert an iPhone app into an iPad app
For that I am autosizing the controls, for button it works fine.
Problem comes when I am Autosizimg the label the position of label changes relatively but the font size of label remains same.
How to increase the label size (i.e. font size of label) by Autosizing label ?
Please Help & Suggest
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
一种选择是选择非常大的默认字体大小,并设置
这将适用于单行标签。对于多行,您将需要做更多的事情。
One option would be to chose a very large default font size, and set
This will work for a single-line label. For multiline, you will need to do more.
我动态添加了对设备是iPhone还是iPad的检查,并根据当前设备设置标签文本的字体大小
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
//iPad 代码
别的
//iPhone 或 iPod 的代码
I have dynamically added the check for whether the device is iPhone or iPad and set the font size of label text according to the current device
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
//Code for iPad
else
//Code for iPhone or iPod