UINavigationController详解(四)iOS7新特性

@导航栏新不同

1.控制器视图默认全屏显示,导航栏的不同设置会带来不一样的效果

2.导航栏的颜色设置为新增属性:barTintColor

3.导航栏的属性:tintColor用于设置控件颜色

4.导航栏背景图片不同的size会展示不同的效果

5.导航栏中设置控件的image对象都需要进行渲染设置.默认是渲染为模板,需要渲染为原图才能显示.默认是渲染为模板,需要渲染为原图才能显示


@导航栏外观

1.bar的样式              barStyle

2.bar的透明度          translucent

3.bar的颜色              barTintColor

4.bar上控件的颜色  tintColor

5.bar的背景图片      backgroundImage


@导航栏布局

1.iOS6和iOS7中,导航栏的布局都是(0,0,320,44)

2.iOS6中,导航栏的背景视图的布局是(0,0,320,44) 和导航栏的布局是一样的

3.iOS7中,导航栏的背景视图的布局是(0,-20,320,64),y轴定位到-20px,高度增加到64px,包含状态栏和导航栏

4.通过设置控制器的 edgesForExtendedLayout 为 UIRectEdgeNone,也可以将控制器视图从导航栏下显示(iOS7新增的属性)


@导航栏内容(新增)

1.返回按钮(Back)指示图像      UIImage *backIndicatorImage                                     

    self.navigationController.navigationBar setBackIndicatorImage:<#(UIImage *)#>

2.返回按钮(Back)遮罩图像      UIImage *backIndicatorTransitionMaskImage          

    [self.navigationController.navigationBar setBackIndicatorTransitionMaskImage:<#(UIImage *)#>


@UIBarButtonItem

1.初始化变化:

   ~ - (id)initWithBarButtonSystemItem:(UIBarButtonSystemItem)systemItem target:(id)target action:(SEL)action;

         系统提供样式改变

   ~ - (id)initWithTitle:(NSString *)title style:(UIBarButtonItemStyle)style target:(id)target action:(SEL)action;

         style设置为 UIBarButtonItemStylePlain(必须)

   ~ - (id)initWithImage:(UIImage *)image style:(UIBarButtonItemStyle)style target:(id)target action:(SEL)action;

         图像需要进行渲染,因为默认渲染是成模板

         - (UIImage *)imageWithRenderingMode:(UIImageRenderingMode)renderingMode NS_AVAILABLE_IOS(7_0);

         typedef NS_ENUM(NSInteger, UIImageRenderingMode) {

               UIImageRenderingModeAutomatic,          // Use the default rendering mode for the context where the image is used

               UIImageRenderingModeAlwaysOriginal,     // 渲染为原始图片

               UIImageRenderingModeAlwaysTemplate,     // 渲染为模板

         } NS_ENUM_AVAILABLE_IOS(7_0);


  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值