iOS 模仿淘宝的首页UI

作者: cb6a1e2768d1 | 来源:发表于2016-04-18 14:29 被阅读2094次

要看UICollectionView的可以关了
全程都是tableview加button和autolayout
最近用autolayout真是越来越顺手了
Level:菜鸟
环境:Xcode7.3 iOS9.3

效果:

6s.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=✓

5s.gif
4s.gif
源码:
https://github.com/icharlie2014/PLTaobaoIndex

相关文章

网友评论

本文标题:iOS 模仿淘宝的首页UI

本文链接:https://www.haomeiwen.com/subject/lccolttx.html