UItabBarとUInavigationBarの内容を設定する方法
2785 ワード
classとstring
[UITabBarButton class] == NSClassFromString(@"UITabBarButton")
[UIButton class] == NSClassFromString(@"UIButton")
@"UITabBarButton" == NSStringFromClass([UITabBarButton class])
UItabBarとUInavigationBarの内容を設定する方法
ナビゲーションバーのタイトルテキストの設定
リッチテキスト
NSMutableDictionary *attrs = [NSMutableDictionary dictionary];
attrs[NSFontAttributeName] = [UIFont systemFontOfSize:13];
attrs[NSUnderlineStyleAttributeName] = @(NSUnderlineStyleSingle);
label.attributedText = [[NSAttributedString alloc] initWithString:@" " attributes:attrs];
NSMutableAttributedString *string = [[NSMutableAttributedString alloc] initWithString:@" "];
[string addAttributes:@{
NSForegroundColorAttributeName : [UIColor blueColor],
NSBackgroundColorAttributeName : [UIColor yellowColor]
} range:NSMakeRange(1, 2)];
[string addAttribute:NSUnderlineColorAttributeName value:[UIColor grayColor] range:NSMakeRange(0, 6)];
[string setAttributes:@{
NSFontAttributeName : [UIFont systemFontOfSize:25]
} range:NSMakeRange(1, 2)];
// addXXX :
// setXXX : ,