有以下页面显示我的讯息,用户可以点击右上角的编辑按钮进入删除状态。点击编辑按钮后,按钮文字改为“取消”,左上角的按钮变为“全选”,同时显示底部工具条带有“删除”按钮

实现起来挺简单的,在正常状态下点击编辑按钮的方法内写入:

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!!!

最新文章

  1. 一个由Response.Redirect 引起的性能问题的分析
  2. 用css伪类实现提示框效果
  3. 【题解】【BST】【Leetcode】Convert Sorted Array to Binary Search Tree
  4. Android低功耗蓝牙(BLE)开发的一点感受
  5. windows环境下nutch2.x 在eclipse中实现抓取数据存进mysql详细步骤
  6. 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
  7. C++中进制转换问题
  8. 201521123082《Java程序设计》第4周学习总结
  9. client.go
  10. H5使用codovar插件实现支付宝支付(支付宝APP支付模式,前端)
  11. LVS+Keepalived高可用部署
  12. 20155327 实验四 Android程序设计
  13. 通俗易懂之Tensorflow summary类 & 初识tensorboard
  14. vue实践中的狗血事件之:mock数据引发的血坑
  15. zoj 3809 枚举水题 (2014牡丹江网赛 A题)
  16. neo4j的配置文件(图文详解)
  17. Java 中 List 和 数组之间的转换
  18. P4562 [JXOI2018]游戏
  19. Windows配置java运行环境的步骤
  20. bzoj 1112 treap树

热门文章

  1. List与数组的相互转换
  2. ros pbstream
  3. 用NotePad++如何实现大小写转换
  4. Codeforces 913C - Party Lemonade
  5. spring boot: spring-data-jpa (Repository/CrudRepository) 数据库操作, @Entity实体类持久化
  6. mysql 视图,事务,存储过程,触发器
  7. Big Problems for Organizers CodeForces - 418D (贪心,直径)
  8. Ubuntu18.04配置静态ip遇到的报错
  9. thinkphp if标签
  10. 51nod1344