我制作了一款iOS应用。在iPhone 6s上,导航栏中的标题是“这是我的应用程序!”。在iPhone 5s上,导航栏中的标题是“这是我的......”。它太长了。是否有可能自动收缩文本或为iPhone 5s设置自己的字体大小或其他标题?
截图
我几乎整天用Google搜索,但找不到任何有用的提示。
有人有想法吗?
答案 0 :(得分:1)
UILabel
,定义其框架,指定文字启用文本的自动调整
label.adjustsFontSizeToFitWidth=YES;
label.minimumScaleFactor=0.5;
将标签设置为视图控制器的navigationItem
的titleView
self.navigationItem.titleView = label;
答案 1 :(得分:0)
试试这个
var proc = Process.Start("popup.exe");
while (string.IsNullOrEmpty(proc.MainWindowTitle))
{
System.Threading.Thread.Sleep(100);
proc.Refresh();
}