ios - 更改 UIToolbar 字体大小 - iOS

标签 ios uitoolbar font-size

有没有办法改变 UIToolbar 中字体的大小?我的文字放不下,所以我需要缩小它。

谢谢!

最佳答案

这是一个例子。我不确定你想要什么,但你可以在 uitoolbar 中调整 uibarbuttonitem 的字体大小。

 UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0,0,10,15)];
             label.font = [UIFont systemFontOfSize:15.0];
             label.textColor = [UIColor blackColor];
             label.backgroundColor = [UIColor clearColor];
             //label.adjustsFontSizeToFitWidth = YES;
             label.textAlignment = UITextAlignmentCenter;
             label.text = @"Bar";


     UIBarButtonItem *item2 = [[UIBarButtonItem alloc]   
     initWithCustomView:label];

关于ios - 更改 UIToolbar 字体大小 - iOS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7192844/

相关文章:

ios - 通过 initWithRootViewController 以外的方法设置 UINavigationController 的 rootViewController

iphone - UIToolbar UIBarButtonItem 对齐问题

python - 轴上科学记数法的字体大小不一致

iphone - 动态创建 uibarbutton 不起作用

ios - 沙盒自动续订订阅能否在应用程序重新安装后继续存在

ios - 如何将 View 添加到 subview ?

ios - 如何在应用程序运行时知道 vpn 是否打开?

ios - 显示/隐藏位于 UIToolbar 中间的 UIBarButtonItem

css - 即使我设置了 html 字体大小,REM 大小也不会更新

javascript - 缩放不同长度的文本以适合容器宽度