//
//  OneViewController.swift
//  tab
//
//  Created by su on 15/12/7.
//  Copyright © 2015年 tian. All rights reserved.
//

import UIKit

let ID = "cell"

class OneViewController: UIViewController,UITableViewDelegate, UITableViewDataSource {

//    let myTabelView:UITableView!
   
   
    override func viewDidLoad() {
        super.viewDidLoad()
       
        self.view.backgroundColor = UIColor.blueColor()
        self.navigationItem.title = "aa"
        //创建tableview
        let tabelView = UITableView(frame: view.bounds, style: UITableViewStyle.Plain)
       
        //注册cell
        tabelView.registerClass(UITableViewCell.self, forCellReuseIdentifier: ID)
        //下边这种方法也是可以的
//        tabelView.registerClass(UITableViewCell.classForCoder(), forCellReuseIdentifier: ID)
        //设置代理和数据源
        tabelView.delegate = self
        tabelView.dataSource = self
        tabelView.tableFooterView = UIView()
       
        //加到view上
        self.view.addSubview(tabelView)
       
    }
   
     func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return 10
    }
   
     func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCellWithIdentifier(ID, forIndexPath: indexPath)
        cell.textLabel!.text = "假数据"
        return cell
    }

override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

/*
    // MARK: - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}

swift学习之UITabelView ----UITableViewCell的更多相关文章

  1. swift学习之UITabelView ----使用xib定义cell

    // //  TwoViewController.swift //  tab // //  Created by su on 15/12/7. //  Copyright © 2015年 tian. ...

  2. 【swift学习笔记】二.页面转跳数据回传

    上一篇我们介绍了页面转跳:[swift学习笔记]一.页面转跳的条件判断和传值 这一篇说一下如何把数据回传回父页面,如下图所示,这个例子很简单,只是把传过去的数据加上了"回传"两个字 ...

  3. 今天开始Swift学习

    今天开始Swift学习  在此记录笔记  以备之后查阅! allenhuang

  4. iOS ---Swift学习与复习

    swift中文网 http://www.swiftv.cn http://swifter.tips/ http://objccn.io/ http://www.swiftmi.com/code4swi ...

  5. 12套swift学习资源分享

    虽然objective-c编程语言在过去很长一段时间都是iOS应用开发的基础语言,且很多iOS开发者对其也深爱有佳,但是随着swift编程语言的问世,迅速发展为开发者追捧的语言.且今年伴随着swift ...

  6. Swift学习之常用UI的使用

    Swift学习之常用UI的使用 最近笔者在开始学习苹果最新的编程语言,因为笔者认为,苹果既然出了这门语言就绝对不会放弃,除非苹果倒闭了(当然这里知识一个玩笑). 所以在不久的将来,swift绝对是iO ...

  7. [转]swift 学习资源 大集合

    今天看到了一个swift的学习网站,里面收集了很多学习资源 [转自http://blog.csdn.net/sqc3375177/article/details/29206779] Swift 介绍 ...

  8. swift 学习资源 大集合

    今天看到一个swift学习网站,其中我们收集了大量的学习资源 Swift 介绍 Swift 介绍 来自 Apple 官方 Swift 简单介绍 (@peng_gong) 一篇不错的中文简单介绍 [译] ...

  9. Swift学习笔记(一)搭配环境以及代码运行成功

    原文:Swift学习笔记(一)搭配环境以及代码运行成功 1.Swift是啥? 百度去!度娘告诉你它是苹果最新推出的编程语言,比c,c++,objc要高效简单.能够开发ios,mac相关的app哦!是苹 ...

随机推荐

  1. centos 6.5 下 安装 git

    2018-07-02 centos安装Git有两种方式,一种通过源安装,通过如下命今,即可一键安装成功: yum -y install git 但是通过源安装的Git,目前最高版本是1.7,想要使用更 ...

  2. 添加APP右上角数字提醒标识

    mui.plusReady(function() { plus.nativeUI.closeWaiting(); mui.currentWebview.show(); //1.设置app右上角数字提醒 ...

  3. Java--不可覆盖的方法

    私有方法不能被覆盖: 因为private被自动认为final,对子类是屏蔽的,那么子类中的相同方法就是一个新的方法,编译器不会报错但也不会按期望运行: public class ClassA { pr ...

  4. bzoj2865 字符串识别

    Description XX在进行字符串研究的时候,遇到了一个十分棘手的问题. 在这个问题中,给定一个字符串S,与一个整数K,定义S的子串T=S(i, j)是关于第K位的识别子串,满足以下两个条件: ...

  5. PAT 甲级 1010 Radix (25)(25 分)进制匹配(听说要用二分,历经坎坷,终于AC)

    1010 Radix (25)(25 分) Given a pair of positive integers, for example, 6 and 110, can this equation 6 ...

  6. CSS布局模型学习

    转自:http://www.cnblogs.com/erliang/p/4092192.html CSS布局模型学习   参考链接慕课网:HTML+CSS基础课程 知识基础 1. 样式 内联 嵌入 外 ...

  7. 2018 Multi-University Training Contest 4-Glad You Came(hdu 6356)

    一.思路 线段树维护一个区间最小值,然后对于每次操作,做区间更新即可.要注意的是,在更新的时候,记得剪枝:如果当前更新的值$v \le minv$(minv为当前线段树节点所管辖区间的最小值),直接返 ...

  8. PDF预览之PDFObject.js总结

    get from:PDF预览之PDFObject.js总结   PDFObject.js - 将PDF嵌入到一个div内,而不是占据整个页面(要求浏览器支持显示PDF,不支持,可配置PDF.js来实现 ...

  9. ES6系列_12之map数据结构

    1.map数据结构出现的原因? JavaScript 的对象(Object),本质上是键值对的集合(Hash 结构),但是传统上只能用字符串当作键.这给它的使用带来了很大的限制.为了能实现将对象作为键 ...

  10. Spring MVC 学习 之 - 配置简单demo

    1.环境参数: Maven:3.1.1 JDK  :1.6 2.项目文件结构图: 3.各文件配置: 3.1. pom.xml <project xmlns="http://maven. ...