微胖小生

导航

 

2013年12月21日

摘要: 添加多个按钮同样,这个技巧也不是iOS 7的,开发者经常会在导航栏中添加多个按钮,所以我决定在这里进行介绍。我们可以在导航栏左边或者右边添加多个按钮。例如,我们希望在导航栏右边添加一个照相机和分享按钮,那只需要使用下面的代码即可:UIBarButtonItem*shareItem=[[UIBarButtonItemalloc]initWithBarButtonSystemItem:UIBarButtonSystemItemActiontarget:selfaction:nil];UIBarButtonItem*cameraItem=[[UIBarButtonItemalloc]initWith 阅读全文
posted @ 2013-12-21 16:54 微胖小生 阅读(278) 评论(0) 推荐(0) 编辑
 
摘要: 修改导航栏标题的字体 阅读全文
posted @ 2013-12-21 16:44 微胖小生 阅读(1037) 评论(0) 推荐(0) 编辑
 
摘要: 在导航栏中使用背景图片 阅读全文
posted @ 2013-12-21 16:29 微胖小生 阅读(650) 评论(0) 推荐(0) 编辑
 
摘要: 设置导航栏的背景颜色在iOS 7中,不再使用tintColor属性来设置导航栏的颜色,而是使用barTintColor属性来修改背景色。我们可以在AppDelegate.m文件中的方法didFinishLaunchingWithOptions:里面添加如下代码来修改颜色:[[UINavigationBarappearance]setBarTintColor:[UIColoryellowColor]];效果如下图所示:一般情况,我们都会使用自己的颜色,下面这个宏用来设置RGB颜色非常方便:#defineUIColorFromRGB(rgbValue)[UIColorcolorWithRed:(( 阅读全文
posted @ 2013-12-21 16:24 微胖小生 阅读(1984) 评论(0) 推荐(0) 编辑