您的位置:首页 > 产品设计 > UI/UE

自定义UINavigationBar

2014-05-12 10:06 183 查看
在AppDelegate.m中

设置背景

1 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
2     UIImage *image = [UIImageimageNamed:@"tab_bg.png"];
3     [[UINavigationBar appearance] setBackgroundImage:image
4                                        forBarMetrics:UIBarMetricsDefault];   // UIBarMetricsLandscapePhone
5 }


 

设置标题

1 [[UINavigationBar appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
2  [UIColor colorWithRed:255.0/255.0 green:255.0/255.0 blue:55.0/255.0 alpha:1.0],
3         UITextAttributeTextColor,
4         [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.8],
5         UITextAttributeTextShadowColor,
6         [NSValue valueWithUIOffset:UIOffsetMake(0, -1)],
7         UITextAttributeTextShadowOffset,
8         [UIFont fontWithName:@"Arial-Bold" size:0.0],
9         UITextAttributeFont,nil]];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  uiimage