![](/img/trans.png)
[英]Presenting UIAlertController increases UILabel font size inside UIToolbar in iOS 11
[英]Change UIToolbar Font Size - iOS
有沒有辦法在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];
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.