SWIFT显示底部的工具条
2024-08-29 00:53:10
有以下页面显示我的讯息,用户可以点击右上角的编辑按钮进入删除状态。点击编辑按钮后,按钮文字改为“取消”,左上角的按钮变为“全选”,同时显示底部工具条带有“删除”按钮
实现起来挺简单的,在正常状态下点击编辑按钮的方法内写入:
self.navigationController?.setToolbarHidden(false, animated: true)
var btnDelete = UIBarButtonItem(title: "删除", style: UIBarButtonItemStyle.Plain, target: self, action: "deleteAction")
self.setToolbarItems([btnDelete], animated: true)
左上角的按钮改为“全选”
var selectAllButton = UIBarButtonItem(title: "全选", style: UIBarButtonItemStyle.Plain, target: self, action: "selectAll")
navigationItem.leftBarButtonItem = selectAllButton
so easy!!!
最新文章
- 一个由Response.Redirect 引起的性能问题的分析
- 用css伪类实现提示框效果
- 【题解】【BST】【Leetcode】Convert Sorted Array to Binary Search Tree
- Android低功耗蓝牙(BLE)开发的一点感受
- windows环境下nutch2.x 在eclipse中实现抓取数据存进mysql详细步骤
- Can't create a new thread (errno 11); if you are not out of available memory, you can consult the manual for a possible OS-dependent bug
- C++中进制转换问题
- 201521123082《Java程序设计》第4周学习总结
- client.go
- H5使用codovar插件实现支付宝支付(支付宝APP支付模式,前端)
- LVS+Keepalived高可用部署
- 20155327 实验四 Android程序设计
- 通俗易懂之Tensorflow summary类 &; 初识tensorboard
- vue实践中的狗血事件之:mock数据引发的血坑
- zoj 3809 枚举水题 (2014牡丹江网赛 A题)
- neo4j的配置文件(图文详解)
- Java 中 List 和 数组之间的转换
- P4562 [JXOI2018]游戏
- Windows配置java运行环境的步骤
- bzoj 1112 treap树
热门文章
- List与数组的相互转换
- ros pbstream
- 用NotePad++如何实现大小写转换
- Codeforces 913C - Party Lemonade
- spring boot: spring-data-jpa (Repository/CrudRepository) 数据库操作, @Entity实体类持久化
- mysql 视图,事务,存储过程,触发器
- Big Problems for Organizers CodeForces - 418D (贪心,直径)
- Ubuntu18.04配置静态ip遇到的报错
- thinkphp if标签
- 51nod1344