开发者

Change UIToolbar Font Size - iOS

Is there a way to change the size of the font in a UIToolbar? My text does not fit so I need to make it smaller.

Th开发者_JS百科anks!


Here is one example. I am not sure what you want, but you can resize the font size of uibarbuttonitem in uitoolbar.

 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];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜