【UIKit】-13-UIBarButtonItem - barButton



http://blog.csdn.net/sirchenhua/article/details/7299932
http://blog.csdn.net/kmyhy/article/details/7174162
http://www.2cto.com/kf/201305/208473.html

暂无实例,待修改
A bar button item is a button specialized for placement on a UIToolbar or UINavigationBar object. It inherits basic button behavior from its abstract superclass, UIBarItem. The UIBarButtonItem defines additional initialization methods and properties for use on toolbars and navigation bars. You typically use Interface Builder to create and configure bar button items.

酒吧按钮项是专门用于放置一个UIToolbar或UINavigationBar的对象上的按钮。它继承自它的抽象父类,UIBarItem基本按钮的行为。该定义的UIBarButtonItem额外的初始化的方法和属性上的工具栏和导航栏使用。您通常使用Interface Builder来创建和配置栏按钮的项目。


 

#import <CoreGraphics/CoreGraphics.h>

#import <Foundation/Foundation.h>

#import <UIKit/UIBarItem.h>

#import <UIKit/UIKitDefines.h>

#import <UIKit/UIAppearance.h>

#import <UIKit/UIApplication.h>

#import <UIKit/UIBarCommon.h>

 

typedef NS_ENUM(NSInteger,UIBarButtonItemStyle) {

   UIBarButtonItemStylePlain,

   UIBarButtonItemStyleBordered NS_ENUM_DEPRECATED_IOS(2_0,8_0, "UseUIBarButtonItemStylePlain when minimum deployment target is iOS7 or later"),

   UIBarButtonItemStyleDone,

};

 

typedef NS_ENUM(NSInteger,UIBarButtonSystemItem) {

   UIBarButtonSystemItemDone,

   UIBarButtonSystemItemCancel,

    UIBarButtonSystemItemEdit, 

   UIBarButtonSystemItemSave, 

   UIBarButtonSystemItemAdd,

   UIBarButtonSystemItemFlexibleSpace,

   UIBarButtonSystemItemFixedSpace,

   UIBarButtonSystemItemCompose,

   UIBarButtonSystemItemReply,

   UIBarButtonSystemItemAction,

   UIBarButtonSystemItemOrganize,

   UIBarButtonSystemItemBookmarks,

   UIBarButtonSystemItemSearch,

   UIBarButtonSystemItemRefresh,

   UIBarButtonSystemItemStop,

   UIBarButtonSystemItemCamera,

   UIBarButtonSystemItemTrash,

   UIBarButtonSystemItemPlay,

   UIBarButtonSystemItemPause,

   UIBarButtonSystemItemRewind,

   UIBarButtonSystemItemFastForward,

#if __IPHONE_3_0 <= __IPHONE_OS_VERSION_MAX_ALLOWED

   UIBarButtonSystemItemUndo,

   UIBarButtonSystemItemRedo,

#endif

#if __IPHONE_4_0 <= __IPHONE_OS_VERSION_MAX_ALLOWED

   UIBarButtonSystemItemPageCurl,

#endif

};

 

@class UIImageUIView;

 

NS_CLASS_AVAILABLE_IOS(2_0)@interface UIBarButtonItem: UIBarItem <NSCoding> {

  @private

    NSString     *_title;

    NSSet        *_possibleTitles;

    SEL           _action;

    id            _target;

    UIImage      *_image;

    UIImage      *_landscapeImagePhone;

    UIEdgeInsets  _imageInsets;

    UIEdgeInsets  _landscapeImagePhoneInsets;

    CGFloat       _width;  

    UIView       *_view;

    NSInteger     _tag;

    id            _appearanceStorage;

    struct {

        unsigned int enabled:1;

        unsigned int style:3;

        unsigned int isSystemItem:1;

        unsigned int systemItem:7;

        unsigned int viewIsCustom:1;

        unsigned int isMinibarView:1;

        unsigned intdisableAutosizing:1;

        unsigned int selected:1;

        unsigned int imageHasEffects:1;

    }_barButtonItemFlags;

}

 

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

- (instancetype)initWithImage:(UIImage *)image landscapeImagePhone:(UIImage *)landscapeImagePhone style:(UIBarButtonItemStyle)style target:(id)target action:(SEL)actionNS_AVAILABLE_IOS(5_0);

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

- (instancetype)initWithBarButtonSystemItem:(UIBarButtonSystemItem)systemItemtarget:(id)targetaction:(SEL)action;

- (instancetype)initWithCustomView:(UIView *)customView;

 

@property(nonatomic)        UIBarButtonItemStyle style;            // default is UIBarButtonItemStylePlain

@property(nonatomic)        CGFloat             width;            // default is 0.0

@property(nonatomic,copy)   NSSet              *possibleTitles;   // default is nil

@property(nonatomic,retainUIView             *customView;       // default is nil

@property(nonatomic)        SEL                  action;           // default is NULL

@property(nonatomic,assignid                  target;           // default is nil

 

- (void)setBackgroundImage:(UIImage *)backgroundImage forState:(UIControlState)statebarMetrics:(UIBarMetrics)barMetricsNS_AVAILABLE_IOS(5_0)UI_APPEARANCE_SELECTOR;

- (UIImage *)backgroundImageForState:(UIControlState)state barMetrics:(UIBarMetrics)barMetricsNS_AVAILABLE_IOS(5_0)UI_APPEARANCE_SELECTOR;


- (void)setBackgroundImage:(UIImage *)backgroundImage forState:(UIControlState)statestyle:(UIBarButtonItemStyle)style barMetrics:(UIBarMetrics)barMetricsNS_AVAILABLE_IOS(6_0) UI_APPEARANCE_SELECTOR;

- (UIImage *)backgroundImageForState:(UIControlState)state style:(UIBarButtonItemStyle)style barMetrics:(UIBarMetrics)barMetricsNS_AVAILABLE_IOS(6_0)UI_APPEARANCE_SELECTOR;

 

@property(nonatomic,retain)UIColor *tintColor NS_AVAILABLE_IOS(5_0);


- (void)setBackgroundVerticalPositionAdjustment:(CGFloat)adjustmentforBarMetrics:(UIBarMetrics)barMetricsNS_AVAILABLE_IOS(5_0)UI_APPEARANCE_SELECTOR;

- (CGFloat)backgroundVerticalPositionAdjustmentForBarMetrics:(UIBarMetrics)barMetricsNS_AVAILABLE_IOS(5_0)UI_APPEARANCE_SELECTOR;

 

- (void)setTitlePositionAdjustment:(UIOffset)adjustment forBarMetrics:(UIBarMetrics)barMetricsNS_AVAILABLE_IOS(5_0)UI_APPEARANCE_SELECTOR;

- (UIOffset)titlePositionAdjustmentForBarMetrics:(UIBarMetrics)barMetricsNS_AVAILABLE_IOS(5_0)UI_APPEARANCE_SELECTOR;


- (void)setBackButtonBackgroundImage:(UIImage *)backgroundImage forState:(UIControlState)statebarMetrics:(UIBarMetrics)barMetricsNS_AVAILABLE_IOS(5_0)UI_APPEARANCE_SELECTOR;

- (UIImage *)backButtonBackgroundImageForState:(UIControlState)statebarMetrics:(UIBarMetrics)barMetricsNS_AVAILABLE_IOS(5_0)UI_APPEARANCE_SELECTOR;

 

- (void)setBackButtonTitlePositionAdjustment:(UIOffset)adjustmentforBarMetrics:(UIBarMetrics)barMetricsNS_AVAILABLE_IOS(5_0)UI_APPEARANCE_SELECTOR;

- (UIOffset)backButtonTitlePositionAdjustmentForBarMetrics:(UIBarMetrics)barMetricsNS_AVAILABLE_IOS(5_0)UI_APPEARANCE_SELECTOR;

 

- (void)setBackButtonBackgroundVerticalPositionAdjustment:(CGFloat)adjustmentforBarMetrics:(UIBarMetrics)barMetricsNS_AVAILABLE_IOS(5_0)UI_APPEARANCE_SELECTOR;

- (CGFloat)backButtonBackgroundVerticalPositionAdjustmentForBarMetrics:(UIBarMetrics)barMetricsNS_AVAILABLE_IOS(5_0)UI_APPEARANCE_SELECTOR;

 

@end

 

 



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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值