当前位置:K88软件开发文章中心编程语言APP编程CrossApp → 文章内容

CABarButtonItem

减小字体 增大字体 作者:佚名  来源:网上搜集  发布时间:2019-1-23 13:53:03

由 ?﹏???ζ???﹏﹏? 创建, 最后一次修改 2016-09-10 类说明自定义导航栏按钮,辅助navigationBarItem的功能实现。基类CABarItemCABarButtonItem 属性(点击查看方法介绍)属性说明HighlightedImage高亮时的图像ItemWidth项目宽度CustomView自定义视图CABarButtonItem 方法(点击查看方法介绍)属性说明create创建,指定标题、图像和按钮点击时的图像init初始化,指定标题、图像和按钮点击时的图像,默认图像和按钮点击时的图像为NULLinitWithTitle初始化标题,指定标题、图像和按钮点击时的图像,默认图像和按钮点击时的图像为NULLinitWithImage初始化图像,指定图像和高亮时的图像,默认高亮时的图像为NULLinitWithCustomView初始化图像,指定图像和按钮点击时的图像,默认按钮点击时的图像为NULLsetTarget设置回调函数getTarget获取回调函数getSel获取SELCABarButtonItem 属性说明HighlightedImage类型:CAImage*解释:点击按钮时,高亮状态的图片。set/get{}。ItemWidth类型:unsigned int解释:项目宽度,set/get{}。CustomView类型:CAView*解释:自定义视图,get{}。CABarButtonItem 方法说明static CABarButtonItem* create(const std::string& title, CAImage* image, CAImage* highlightedImage);返回值:CABarButtonItem*参数:类型参数名说明const std::string&title标题CAImage*image图像CAImage* highlightedImage按钮点击时的图像解释:创建,指定标题、图像和按钮点击时的图像bool init(const std::string& title, CAImage* image = NULL, CAImage* highlightedImage = NULL)返回值:bool参数:类型参数名说明const std::string&title标题CAImage*image图像CAImage* highlightedImage按钮点击时的图像解释:初始化,指定标题、图像和按钮点击时的图像,默认图像和按钮点击时的图像为NULLbool initWithTitle(const std::string& title, CAImage* image = NULL, CAImage* highlightedImage = NULL);返回值:bool参数:类型参数名说明const std::string&title标题CAImage*image图像CAImage* highlightedImage按钮点击时的图像解释:初始化标题,指定标题、图像和按钮点击时的图像,默认图像和按钮点击时的图像为NULLbool initWithImage(CAImage* image, CAImage* highlightedImage = NULL);返回值:bool参数:类型参数名说明CAImage*image图像CAImage* highlightedImage按钮点击时的图像解释:初始化图像,指定图像和按钮点击时的图像,默认按钮点击时的图像为NULLbool initWithCustomView(CAView* customView);返回值:bool参数:类型参数名说明CAView*customView自定义图像解释:初始化自定义图像,指定自定义图像void setTarget(CAObject* target, SEL_CAControl callfunc);返回值:void参数:类型参数名说明CAObject* target当前对象SEL_CAControl callfunc函数回调器解释:为按钮添加一个点击事件CAObject* getTarget();返回值:CAObject*参数:解释:获取回当前对象SEL_CAControl getSel();返回值:SEL_CAControl参数:解释:获取按钮点击事件的回调函数器

CABarButtonItem