UITableView创建
来源:互联网 发布:马云的淘宝怎么赚钱的 编辑:程序博客网 时间:2024/06/05 22:41
appdelegate.m
- (void) dealloc
{
[_windowrelease];
_window = nil;
[superdealloc];
}
FirstViewController * first = [[FirstViewControlleralloc] init];
UINavigationController * nav = [[UINavigationControlleralloc] initWithRootViewController:first];
[_windowsetRootViewController:nav];
[firstrelease];
[navrelease];
UIViewController.h
添加 协议
<UITableViewDataSource,UITableViewDelegate>
.m
#import "FirstViewController.h"
@interface FirstViewController ()
@end
@implementation FirstViewController
- (void) dealloc
{
[superdealloc];
}
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [superinitWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[superviewDidLoad];
// Do any additional setup after loading the view.
UITableView * tableView = [[UITableViewalloc] initWithFrame:CGRectMake(0,0, 320,416) style:UITableViewStylePlain];
[tableView setBackgroundColor:[UIColororangeColor]];
[tableViewsetDataSource:self];
[tableViewsetDelegate:self];
[self.viewaddSubview:tableView];
[tableViewrelease];
self.navigationController.navigationBar.translucent = NO;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 10;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString * cellIdentify =@"cellIdentify";
UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:cellIdentify];
if (cell == NULL) {
cell = [[[UITableViewCellalloc] initWithStyle:UITableViewCellStyleValue1reuseIdentifier:cellIdentify] autorelease];
}
[cell.textLabelsetText:@"骚委"];
[cell.textLabelsetTextColor:[UIColororangeColor]];
return cell;
}
@end
- UITableView创建
- UITableView创建
- UItableView创建
- UITableView 手动创建
- 创建横向的UITableView
- 创建横向的UitableView
- UITableView创建样式
- 创建第一个UITableView
- Swift创建UITableview
- UITableView的创建和使用
- iOS使用Swift创建UITableView
- UITableView的创建与使用
- Iphone UITableView 创建最简单的表格
- UITableView 使用方法(一) - 创建简单的列表
- 怎样创建表格---UITableView UITableViewDataSource UITableViewDelegate
- 怎样创建表格---UITableView UITableViewDataSource UITableViewDelegate .
- UITableView 使用方法(一) - 创建简单的列表
- UITableView表格的创建(React Native)
- C++ sscanf()用法
- 跨站点脚本
- (1)创建用户定义的数据类型
- ajax跨域请求jsonp
- C语言中volatile关键字的作用
- UITableView创建
- java.lang.OutOfMemoryError: Java heap space
- 从外网访问内网本机的网站实现方法分享
- Android Hal 分析
- ZOJ-2750
- 次时代网络推广介绍
- shell写的算术乘法表
- Leetcode – Add Two Numbers (Java)
- 九度题目1209:最小邮票数