NavigationBar title的设置,背景颜色,图片
2014-11-24 14:59
405 查看
//设置背景图片
UIImage *navipicture=[UIImage imageNamed:@"xxx.png"];
//九宫格拉伸
navipicture=[navipicture stretchableImageWithLeftCapWidth:10 topCapHeight:5];
[self.navigationController.navigationBar setBackgroundImage:navipicture forBarMetrics:UIBarMetricsDefault];
//设置navigationbar的背景颜色颜色
self.navigationController.navigationBar.barTintColor=[UIColor
colorWithRed:65.0/255
green:105.0/255
blue:225.0/255
alpha:1];
[self.navigationItem
setTitle:@"xxxx"];
//navigation标题的初始化
NSShadow *shadow = [[NSShadow
alloc] init];
shadow.shadowColor = [UIColor
colorWithRed:0.0
green:0.0
blue:0.0
alpha:0.5];
shadow.shadowOffset =
CGSizeMake(0,
1);
[self.navigationController.navigationBar
setTitleTextAttributes: [NSDictionary
dictionaryWithObjectsAndKeys:
[UIColor
whiteColor], NSForegroundColorAttributeName,
shadow,
NSShadowAttributeName,
[UIFont
fontWithName:@"HelveticaNeue-CondensedBlack"
size:21.0],
NSFontAttributeName,
nil]];
UIImage *navipicture=[UIImage imageNamed:@"xxx.png"];
//九宫格拉伸
navipicture=[navipicture stretchableImageWithLeftCapWidth:10 topCapHeight:5];
[self.navigationController.navigationBar setBackgroundImage:navipicture forBarMetrics:UIBarMetricsDefault];
//设置navigationbar的背景颜色颜色
self.navigationController.navigationBar.barTintColor=[UIColor
colorWithRed:65.0/255
green:105.0/255
blue:225.0/255
alpha:1];
[self.navigationItem
setTitle:@"xxxx"];
//navigation标题的初始化
NSShadow *shadow = [[NSShadow
alloc] init];
shadow.shadowColor = [UIColor
colorWithRed:0.0
green:0.0
blue:0.0
alpha:0.5];
shadow.shadowOffset =
CGSizeMake(0,
1);
[self.navigationController.navigationBar
setTitleTextAttributes: [NSDictionary
dictionaryWithObjectsAndKeys:
[UIColor
whiteColor], NSForegroundColorAttributeName,
shadow,
NSShadowAttributeName,
[UIFont
fontWithName:@"HelveticaNeue-CondensedBlack"
size:21.0],
NSFontAttributeName,
nil]];
相关文章推荐
- navigationItem.rightBarButtonItem 设置背景图片,颜色更改解决办法
- navigationItem.rightBarButtonItem 设置背景图片,颜色更改解决的方法
- IOS navigationItem 设置返回button,title图片和rightBarButtonItem
- UINavigationController navigationBar 背景颜色设置问题
- 快速设置UINavbar的属性包括背景 title的颜色字体以及改变返回键的图片
- 修改navigationBar title的背景颜色
- IOS设置导航栏全局的背景图片、导航栏title文字颜色大小、导航栏左右按钮的颜色。
- actionbar设置背景图片和文字颜色
- ios 5.0 设置navigationbar / toolbar 背景图片的方法 (以前用的设置navgationbar的背景图片的方法已经失效)
- IOS navigationItem 设置返回按钮,title图片和rightBarButtonItem
- 设置navigationbar title颜色
- qt设置widget的背景颜色和图片
- Qt中设置widget背景颜色/图片的注意事项(使用样式表 setStyleSheet())
- MFC中设置对话框颜色、添加背景图片、添加音乐的方法
- Qt布局管理之边栏及背景颜色和图片的设置
- Qt中设置widget背景颜色/图片的注意事项(使用样式表 setStyleSheet())
- VC 对话框设置背景颜色和图片
- Qt中设置widget背景颜色/图片的注意事项(使用样式表 setStyleSheet())
- 自定义UINavigationBar背景图片和颜色
- 自定义UINavigationBar背景图片和颜色