使用UIToolBar给textFiled的inputView添加按钮
来源:互联网 发布:阿里郎软件 编辑:程序博客网 时间:2024/05/24 23:12
首先,textField的inputView属性可以指定其他视图代替keyBoard弹出。
// 创建工具条UIToolbar *toolBar = [[UIToolbar alloc] init];// 设置工具条的颜色 toolBar.barTintColor = [UIColor cyanColor];// 设置工具条的frametoolBar.frame = CGRectMake(0, 0, self.view.frame.size.width, 44);// 给工具栏添加按钮UIBarButtonItem *item1 = [[UIBarButtonItem alloc] initWithTitle:@"上一个" style:UIBarButtonItemStylePlain target:self action:@selector(itemAction)];UIBarButtonItem *item2 = [[UIBarButtonItem alloc] initWithTitle:@"下一个" style:UIBarButtonItemStylePlain target:self action:@selector(itemAction)];UIBarButtonItem *flexibleItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];UIBarButtonItem *item3 = [[UIBarButtonItem alloc] initWithTitle:@"完成" style:UIBarButtonItemStylePlain target:self action:@selector(itemAction)];toolBar.items = @[item1, item2, flexibleItem, item3];self.textFiled.inputAccessoryView = toolBar;
阅读全文
0 0
- 使用UIToolBar给textFiled的inputView添加按钮
- 如何给UIToolBar 添加 多个UIBarButtonItem
- UIToolBar的单独使用
- UIToolBar的使用
- UIToolBar工具栏的使用
- UI:UIToolBar的使用
- UIToolbar的使用
- iOS UIToolBar的使用
- UIToolBar的使用
- 使用自绘的按钮,怎样给他添加位图
- 为UIToolBar添加按钮,并调整按钮位置
- UIToolBar工具条按钮间距的调整
- 【iOS开发-70】点菜系统案例:利用文本框的inputView和inputAccessoryView串联UIPickerView、UIDatePicker和UIToolBar
- iOS之UIToolBar的使用
- iOS开发 UIToolBar的使用
- 如何给UIToolBar 添加 多个UIBarBu…
- 给datagrid的按钮列添加css
- 给网页的按钮添加快捷键
- 一些博客和网站收录
- 使用openfire安装虚拟服务器
- CALayer
- app打包上架
- UICollectionView的基本使用
- 使用UIToolBar给textFiled的inputView添加按钮
- Codeforces AIM Tech Round 4 (Div. 2) C Sorting by Subsequences (dfs)
- mac下mysql初学
- django项目创建的步骤
- django连接mysql数据库
- Atlassian插件开发
- Atlassian插件开发
- Atlassian插件开发
- Atlassian插件开发