要看UICollectionView的可以关了
全程都是tableview加button和autolayout
最近用autolayout真是越来越顺手了
Level:菜鸟
环境:Xcode7.3 iOS9.3
效果:
![](https://img.haomeiwen.com/i537940/576154d90baabd60.gif)
顶部轮播就不弄了。
好用的轮播传送:
https://github.com/gsdios/SDCycleScrollView
图片我都是截图的command+shift+4
主要是学习autolayout
注意的几个点:
1.任何自定义view都可以用storyboard里的cell做,只要用到tableview时,都如下取到自定义view,不需要重新自定义xib(主要是使用xib之后,在放回controller里要设置frame):
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
static NSString *cellIdentifier = @"sectionHeadView";
UITableViewCell *headView =[tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if(!headView){
headView=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
}
return headView;
}
2.倒计时
传送:https://github.com/search?q=倒计时&type=Repositories&utf8=✓
![](https://img.haomeiwen.com/i537940/6a337102bd0ced42.gif)
![](https://img.haomeiwen.com/i537940/83e95f75d422854b.gif)
源码:
https://github.com/icharlie2014/PLTaobaoIndex
网友评论