zoukankan      html  css  js  c++  java
  • 使用TableView

    关键代码如下:

     1 import UIKit
     2 
     3 class MyTV: UITableView ,UITableViewDataSource{
     4 
     5     let table_cell=1
     6     
     7     var array=["尽子轨","渣渣将","swift"]
     8     
     9     init(coder aDecoder:NSCoder!){
    10         super.init(coder:aDecoder)
    11         self.dataSource=self
    12     }
    13     init(frame: CGRect) {
    14         super.init(frame: frame)
    15         // Initialization code
    16     }
    17     func numberOfSectionsInTableView(tableView: UITableView!) -> Int {
    18         return 1
    19     }
    20     
    21     func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell! {
    22         var cell : AnyObject!=tableView.dequeueReusableCellWithIdentifier("cell")
    23         var label=cell.viewWithTag(table_cell) as UILabel
    24         label.text=array[indexPath.row]
    25         return cell as UITableViewCell
    26     }
    27     
    28     func tableView(tableView: UITableView!, numberOfRowsInSection section: Int) -> Int {
    29         return 3
    30     }
    31     
  • 相关阅读:
    iptables和DNS
    centos6.5下载
    linux 系统版本信息
    如何挂载
    Linux网络命令
    端口网络等
    linux安装tomcat
    ip设置
    最全DOS的CMD命令,程序员必会
    c语言文件分割与合并
  • 原文地址:https://www.cnblogs.com/newworldcom/p/4458329.html
Copyright © 2011-2022 走看看