要改变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
Chapter 8 UITableView and UITableViewController1. The designated initializer of UITableViewController is initWithStyle:, which takes a constant that d...
分类:
其他好文 时间:
2014-09-18 01:59:23
阅读次数:
191
//1.定义cellstatic NSString * ID=@"hero"; //1.1首先需要进行判断时候需要创建UITableViewCell对象 UITableViewCell * cell=[tableView dequeueReusableCellWithIdentifier:ID].....
分类:
其他好文 时间:
2014-09-18 00:44:14
阅读次数:
189
上篇文章介绍了如何用UITableView显示表格,并讲了几种UITableViewCell的风格。不过有时候我们需要自己定义UITableViewCell的风格,其实就是向行中添加子视图。添加子视图的方法主要有两种:使用代码以及从.xib文...
分类:
移动开发 时间:
2014-09-15 22:59:10
阅读次数:
653
UIScrollView中添加了一个手势 UITapGestureRecognizer *_tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(foregroundTapped:)]...
分类:
移动开发 时间:
2014-09-12 11:39:13
阅读次数:
184
文件类型AppDelegate.m#import"AppDelegate.h"
#import"MainViewController.h"
@implementationAppDelegate
-(BOOL)application:(UIApplication*)applicationdidFinishLaunchingWithOptions:(NSDictionary*)launchOptions
{
self.window=[[UIWindowalloc]initWithFrame:[[UIScr..
分类:
其他好文 时间:
2014-09-10 09:42:20
阅读次数:
241
UITableViewDataSource 协议中常用方法
1.设置右边索引值
- (NSArray *)sectionIndexTitlesForTableView:(UITableView
*)tableView
2.设置分组标识
- (NSString *)tableView:(UITableView
*)tableView titleForHeaderInSecti...
分类:
移动开发 时间:
2014-09-09 16:13:58
阅读次数:
175
新建一个UITableView的子类,在其中实现UITableView创建的代理步骤,唯一不同是需要建一个属性数组,用来传递数据然后再ViewController初始化并设置正确的代理对象此方法适用同一个界面多个UITableView使用,好管理数据
分类:
其他好文 时间:
2014-09-09 10:48:58
阅读次数:
220
-(UITableViewCell*)tableView:(UITableView*)tableViewcellForRowAtIndexPath:(NSIndexPath*)indexPath{//重用标识符staticNSString*identifider=@"reuse";//去重用队列中根据标识符取可重用的cellAddressBookCell*cell=[tableViewdequeueReusableCellWithIdentifier:identifi..
分类:
其他好文 时间:
2014-09-05 03:24:31
阅读次数:
208