Coder Social home page Coder Social logo

gbtoplineview's Introduction

GBTopLineView

#仿淘宝头条
##淘宝大家肯定都在用吧,首页部分的头条的那个竖直的轮播大家还记得吧,现在项目里有需求所以就就封装了一下只暴露一个接口给你们用省时间
###如果觉得有用的话请点个星谢谢支持,会继续出一些功能性的框架,如有bug也请指出群号:433060483欢迎加入组织
###特此在这里感谢一下我的同事张世超大家可以去他的主页去踩踩点击名字就可以去了专机接送 O(∩_∩)O哈哈~
#使用说明:

  • 直接把文件包拖入到项目里面在使用的地方包含一下头文件
  • 看一下实例代码:
#pragma mark-创建头条视图
-(void)createTopLineView{
    
    _TopLineView = [[GBTopLineView alloc]initWithFrame:CGRectMake(0, 0, kMidViewWidth, kMidViewHeight)];
    _TopLineView.center = CGPointMake(ScreenWidth/2.0, ScreenHeight/2.0-150);
    _TopLineView.backgroundColor = [UIColor whiteColor];
    __weak __typeof(self)weakSelf = self;
    _TopLineView.clickBlock = ^(NSInteger index){
        GBTopLineViewModel *model = weakSelf.dataArr[index];
        NSLog(@"%@,%@",model.type,model.title);
    };
    [self.view addSubview:_TopLineView];

}
#pragma mark-获取数据
- (void)getData
{
    NSArray *arr1 = @[@"最新",@"最热",@"推荐",@"关注",@"反馈"];
    NSArray *arr2 = @[@"66万硬币买车",@"泰坦尼克号重建",@"小德法网首胜纳达尔",@"欢迎大家来关注我的github主页",@"开发群qq:433060483"];
    for (int i=0; i<arr2.count; i++) {
        GBTopLineViewModel *model = [[GBTopLineViewModel alloc]init];
        model.type = arr1[i];
        model.title = arr2[i];
        [_dataArr addObject:model];
    }
    [_TopLineView setVerticalShowDataArr:_dataArr];
}

##特别说明一下:

* 支持长按手势停留主题界面手势结束的时候恢复轮播

#效果图展示:
##效果图动画不是很流畅,但是不要担心demo跑起来最少在40帧以上动画完全不是gif图那样绝对流畅放心使用
image

gbtoplineview's People

Contributors

mokey1422 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.