放置在toolbar或uinavigationitem上,可以设置点击item触发的方法调用;
初始化方法:
- (instancetype)initWithCustomView:(UIView *)customView; --用自定义view初始化- (instancetype)initWithImage:(UIImage *)image style:(UIBarButtonItemStyle)style target:(id)target action:(SEL)action; --用图片初始化
属性:
target,action用于设置点击item后,触发的方法调用;
width 用于设置宽度,item的高度似乎不可以设置;
UIBarMetrics 表示设备横屏还是竖屏的枚举;
放在tabbar上,与uibarbuttonitem区别在于,uitabbaritem不可以设置点击时触发的方法;
初始化方法:
- (instancetype)initWithTitle:(NSString *)title image:(UIImage *)image selectedImage:(UIImage *)selectedImage;--可以设置点击item和不点击时的image
转载于:.html
本文发布于:2024-02-05 05:09:26,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170724883363320.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |