zoukankan      html  css  js  c++  java
  • Swift

    列表单元格尾部可以添加各种样式的附件,如感叹号,三角箭头等。而且点击内容区域与点击附件的这两个响应事件是不同的,这样可以方便我们实现不同的功能(比如点击内容则查看详情,点击感叹号则编辑)
     


    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    //列表项尾部附件点击
    override func tableView(tableView: UITableView,
        accessoryButtonTappedForRowWithIndexPath indexPath: NSIndexPath) {
        self.tableView!.deselectRowAtIndexPath(indexPath, animated: true)
        var itemString = self.tasks[indexPath.row]
         
        var alertview = UIAlertView();
        alertview.title = "尾部感叹号点击!"
        alertview.message = "你选中了【(itemString)】";
        alertview.addButtonWithTitle("确定")
        alertview.show();
    }
     
    //列表项内容点击
    override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
        self.tableView!.deselectRowAtIndexPath(indexPath, animated: true)
        var itemString = self.tasks[indexPath.row]
         
        var alertview = UIAlertView();
        alertview.title = "列表项内容点击!"
        alertview.message = "你选中了【(itemString)】";
        alertview.addButtonWithTitle("确定")
        alertview.show();
    }
  • 相关阅读:
    简洁搭建hadoop伪分布式文件系统
    在腾讯云下搭建hadoop伪分布式系统
    在腾讯云下搭建hadoop伪分布式系统
    Maven是什么
    地三鲜
    GitHub Pages搭建博客HelloWorld版
    JMS-ActiveMQ
    关于爱情(陈果)-笔记
    新人入职培训
    第三方平台接入汇总
  • 原文地址:https://www.cnblogs.com/Free-Thinker/p/4841066.html
Copyright © 2011-2022 走看看