UICollectionView在2012年被提出,已经不是什么新技术了,在此只是做一下简单的实现。集合视图:UICollectionViewUICollectionView和UITableView类似,它也是datasource和delegate设计模式的:datasource为view提供数据源...
分类:
其他好文 时间:
2014-11-24 09:56:40
阅读次数:
314
在UItableView中使用代理方发-(UIView*)tableView:(UITableView*)tableViewviewForHeaderInSection:(NSInteger)section时,使用UIView自定义的header,发现不能重用,后来发现要想重用必须使用 UITabl...
分类:
其他好文 时间:
2014-11-23 15:39:24
阅读次数:
187
1.在加载cell的地方(即 (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath
*)indexPath里面)加上下面几句代码
[cell setBackgroundColor:CLEARCOLOR];
cell.se...
分类:
其他好文 时间:
2014-11-21 10:41:57
阅读次数:
220
UITableView是不会响应touchesBegan:withEvent:之类的UIResponder的方法的。因此,加在其上的所有视图的响应者链就断了。如果在UITableView其上加任何的自身不具备类似UIButton一样有目标动作机制的UIView及其子类...
分类:
其他好文 时间:
2014-11-20 07:57:57
阅读次数:
140
监测tableview停止滚动- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate{ if (!decelerate) { [self scrolli...
分类:
其他好文 时间:
2014-11-19 22:06:56
阅读次数:
113
在没有分割先的情况下,添加如下方法,当实例化tableview的时候调用该方法.- (void)setExtraCellLineHidden: (UITableView*)tableView{UIView*view =[ [UIView alloc]init];view.backgroundColo...
分类:
其他好文 时间:
2014-11-19 12:17:53
阅读次数:
153
先用xcode5或更低版本创建一个Category,如图:然后拷贝以下代码到.m文件中:- (void) setAlpha:(float)alpha { if (self.superview.tag == noDisableVerticalScrollTag) { if ...
分类:
其他好文 时间:
2014-11-18 23:21:47
阅读次数:
342
在你需要使用的地方,首先要调用到这个UITableView,然后设置它的偏移量为 UITableView的内容高度减去UITableView的试图高度
具体demo:
[self.tableView setContentOffset:CGPointMake(0, self.tableView.contentSize.height - self.tableView.height)];...
分类:
移动开发 时间:
2014-11-18 13:37:28
阅读次数:
159
常规配置如下 当超过tableView显示的范围的时候 后面显示的内容将会和前面重复
// 这样配置的话超过页面显示的内容会重复出现
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
// 定义唯一标识
static NS...
分类:
移动开发 时间:
2014-11-18 10:24:08
阅读次数:
510