ios导航栏添加多个按钮
来源:互联网 发布:皇图护盾进阶数据 编辑:程序博客网 时间:2024/05/14 01:26
开发者经常会在导航栏中添加多个按钮,所以我决定在这里进行介绍。我们可以在导航栏左边或者右边添加多个按钮。例如,我们希望在导航栏右边添加一个照相机和分享按钮,那只需要使用下面的代码即可:
UIBarButtonItem *shareItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:nil];UIBarButtonItem *cameraItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCamera target:self action:nil];NSArray *actionButtonItems = @[shareItem, cameraItem];self.navigationItem.rightBarButtonItems = actionButtonItems;
同理,想要改变导航栏按钮的位置,可以创建个空白的button,添加到button array里。
0 0
- ios导航栏添加多个按钮
- ios----导航栏添加多个按钮
- IOS开发:导航栏添加多个按钮以及在左边添加logo
- ios 导航栏放置多个按钮
- iOS 开发中在导航栏添加多个按钮并改变它的位置
- ios导航添加多个按钮 自定义按钮之间的距离
- xamarin.iOS 导航栏添加按钮
- ios导航栏rightBarButtonItems多个按钮自定义设置
- ios导航栏rightBarButtonItems多个按钮自定义设置
- ios导航条添加按钮
- ios导航条添加按钮
- iOS添加左右导航按钮
- 导航栏添加按钮
- IOS开发(10)UIBarButtonItem导航栏添加按钮
- iOS在控制器导航栏右上角添加按钮
- iOS中为导航栏的右上方添加各种按钮
- (iOS开发)导航栏navigationBar中间添加按钮
- iOS在控制器导航栏右上角添加按钮
- Restarting nginx daemon: nginxnginx: [emerg] bind() to 0.0.0.0:80 failed (98:
- 入职IT公司三天了
- 安装第三方库出现 Python version 2.7 required, which was not found in the registry
- C++ 实现大数相乘
- vim插件备份
- ios导航栏添加多个按钮
- 第七十九天【java虐我千百遍,我待java如初恋】
- linux内核启动内核解压过程分析
- Gank教学贴:Gank是一门艺术 不是固定的套路
- 2014美国大学生数学建模竞赛C题,如何用excel提取合著者的关系
- xz压缩文件方法或命令
- ecshop数据库ecs_stats总是很大的解决方法
- 机房收费系统验收报告
- github 使用