相比于其他的View,UITableView算是用的很广的一个,和UITableView配合使用的是Cell,在程序中可以自定Cell,包括内容样式等UITableView需要一个数据源(dataSource)<UITableViewDataSource>在ViewController中声明做tableView的时候,需要让控制器充当代理的角色在控制..
分类:
其他好文 时间:
2014-09-22 11:52:53
阅读次数:
230
继承自UITableViewController与继承自UIViewController的区别1.前者视图控制器的View是tableview而后者是UIView2.前者无需为tableview指定dataSouce以及delegate并且也无需服从对应的协议,而后者需要指定与服从协议3.前者自动生成协议中的方法,而后者需要自己实现4.前者封装了..
分类:
其他好文 时间:
2014-09-20 02:26:16
阅读次数:
133
第一种方法staticNSString*iden=@"dd";TableViewCell*cell=[tableViewdequeueReusableCellWithIdentifier:iden];if(!cell){cell=[[TableViewCellalloc]initWithStyle:UITableViewCellStyleDefaultreuseIdentifier:iden];}returncell;
分类:
其他好文 时间:
2014-09-20 02:25:26
阅读次数:
148
cell第二种方法(1)staticNSString*ideng=@"reuse";cell第二种方法(2)注册复用cell(cell的类型和标识符)(可以同时注册多个cell,方法相同,一定要保证标识符是不一样的)注册到了tableView的复用池[self.tableViewregisterClass:[TableViewCellclass]forCellReuseIdentifier:ideng]..
分类:
其他好文 时间:
2014-09-20 02:25:06
阅读次数:
158
要改变UITableViewCell选中时的背景色,需要在-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)方法中添加如下代码:// 设置cell选中的背景色UIVi...
分类:
移动开发 时间:
2014-09-19 13:35:35
阅读次数:
164
1 //隐藏分割线 2 [self setExtraCellLineHidden:_tableView]; 3 //隐藏多余分割线 4 -(void)setExtraCellLineHidden: (UITableView *)tableView 5 { 6 UIView *view = ...
分类:
其他好文 时间:
2014-09-18 16:09:14
阅读次数:
174
重设TableView的 contentInset 属性可解决.?_tableView.contentInset = UIEdgeInsetsMake( -30, 0, 0, 0);
分类:
其他好文 时间:
2014-09-18 12:55:33
阅读次数:
227
效果图图片是三张星星图片,1是全星,2是半星,3是空星类的文件AppDelegate.m#import"AppDelegate.h"
#import"MainViewController.h"
@implementationAppDelegate
-(BOOL)application:(UIApplication*)applicationdidFinishLaunchingWithOptions:(NSDictionary*)launchOptions
{
s..
分类:
Web程序 时间:
2014-09-18 09:54:24
阅读次数:
353
//1.定义cellstatic NSString * ID=@"hero"; //1.1首先需要进行判断时候需要创建UITableViewCell对象 UITableViewCell * cell=[tableView dequeueReusableCellWithIdentifier:ID].....
分类:
其他好文 时间:
2014-09-18 00:44:14
阅读次数:
189
LZ的问题是,原来的tableViewList是在ScrollViewAD上的导致,tableView下拉时会被最新加入的scrollView挡住,是因为层级关系,如果将ScrollView作为第一个子视图,则不会影响tableView的下拉效果.
分类:
其他好文 时间:
2014-09-17 20:15:22
阅读次数:
289