经常看见一个页面 三列图片 每一列的图片的大小都不一样 怎么实现的呢 ?可以用瀑布流 。。
这里简单说一下 日后再详细 补上 见谅了 。。。
//主要核心就是 三个并排的 UITableView 放在页面上
// 并且实现 滑动一个另外两个也要滑动 就是联动效果:
- (void)scrollViewDidScroll:(UIScrollView *)scrollView{
NSArray *array = [[NSArray alloc] initWithObjects:tableView1,tableView2,tableView3, nil];
for ( UIScrollView *s in array)) {
if (s != scrollView) {
s.contentOffset = scrollView.contenOffset;
}
}
}
顺便说一下cell 复用 :
UserCell* cell = [tableView dequeueReusableCellWithIdentifier:@"ID"];
if (cell == nil) {
cell = [[[UserCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"ID"] autorelease];
}
旋转90
tableViews = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
CGPoint pointCenter = tableViews.center;//记住旋转前的Center
tableViews.transform = CGAffineTransformMakeRotation(-M_PI /2);//逆时针旋转90
tableViews.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
tableViews.center = pointCenter;//重新定义Center