共 25 篇文章 |
|
阅38 转1 评0 公众公开 14-12-05 09:43 |
} -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ static NSString *ID=@"Cell";2.开启Tableview的编辑模式,[self.tableViewsetEditing:YESanimated:YES],而开启编辑模式的时候会调用editingStyleForRowAtIndexPath返回当前的编辑状态。 阅64 转3 评0 公众公开 14-08-08 14:38 |
} //图片对应的缓存在沙河中的路径 @property (nonatomic, retain) NSString *fileName; //指定默认未加载时,显示的默认图片 @property (nonatomic, retain) UIImage *placeholderImage; //请求网络图片的URL @property (nonatomic, retain) NSString *imageURL; @end AsynImageView.m中的文件内容: 阅475 转3 评0 公众公开 14-06-26 22:12 |
IOS详解TableView——实现九宫格效果。CGFloat width = contentRect.size.width;@protocol ProductCellDelegate <NSObject> @optional - (void)productCell:(ProductCell *)cell actionWithFlag:(NSInteger)flag;- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { Pro... 阅2867 转1 评0 公众公开 14-06-26 15:11 |
iOS UITableView(UIScrollView)滑动到底部的判断。想要判断UITableView滑动到底部,我们需要先了解几个UIScrollView的概念,参照下图:(3)contentSize.height:UIScrollView实际内容的高度,如上图所示包含虚线区域。当 frame.size.height + |contentOffset.y| >= contentSize.height 时即可判断滑到底部了。contentSize.height - contentOff... 阅15128 转96 评1 公众公开 14-05-08 15:22 |
contentSize 是scrollview中的一个属性,它代表scrollview中的可显示区域,假如有一个scrollview,它的frame为(0,0,320,480),而它的contentSize为(320,960).也就是说,这个scrollview整个内容的大小为(320,960),要通过上下滑动scrollview来查看(320,480)后的内容。contentInset 是scrollview中contentView.frame.origin与scrollview.frame.orig... 阅64 转0 评0 公众公开 14-05-08 14:28 |
同时,你可以把整个UIKit的View布局系统看成一个递归的系统,一个view在父view中布局,父view又在其父view中布局,最后直到在UIWindow上布局。分析一下,一个纵向的TableView布局的话,基本上是一个Cell接一个cell在纵向上确定他们的frame就能够布局出来了。在要使用一个Cell的时候我们先去看看tableView中有没有可以重用的cell,如果有就用这... 阅750 转2 评0 公众公开 14-03-09 15:17 |
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ TableViewCell *cell = [self tableView:_tableView cellForRowAtIndexPath:indexPath]; 阅5614 转29 评0 公众公开 14-03-06 16:32 |
//以indexPath来唯一确定cell UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; //出列可重用的cell if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; } //...其他代码} 阅944 转7 评0 公众公开 14-03-06 15:13 |
NSArray *array = [NSArray arrayWithObjects: @"http://static2.dmcdn.net/static/video/451/838/44838154:jpeg_preview_small.jpg?20120509163826", @"http://static2.dmcdn.net/static/video/656/177/44771656:jpeg_preview_small.jpg?20120509154705", @"http://static2.dmcdn.net/static/video/629/228/44822926... 阅588 转0 评0 公众公开 14-03-04 16:59 |