UITabbarItemのフォントを変更したい(選択された時と去れてない時のフォントの種類は一緒)
のですが、下記のコードで試してみても変更することができません...
解決策が分かる方おりましたら、教えて下さい。よろしくお願い致します。
lang
1UITabBarItem *tabBarItem1 = [tabBar.items objectAtIndex:0]; 2tabBarItem1.selectedImage = [[UIImage imageNamed:@"画像名"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate ]; 3 tabBarItem1.image = [[UIImage imageNamed:@"画像名"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal ]; 4 tabBarItem1.title = @"test"; 5 [tabBarItem1 setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIFont fontWithName:@"フォント名" size:10.0f], NSFontAttributeName, nil]forState:UIControlStateNormal]; 6 tabBarItem1.tag = 1; 7 [tabBarItem1 setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0], NSForegroundColorAttributeName,nil] forState:UIControlStateNormal]; 8 [tabBarItem1 setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor colorWithRed:221/255.0 green:221/255.0 blue:221/255.0 alpha:1.0], NSForegroundColorAttributeName,nil] forState:UIControlStateSelected];
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2015/06/13 13:01