top滚动

作者: 动感大猴子 | 来源:发表于2018-07-30 07:54 被阅读0次

    NSArray *btnTitArray = [NSArray arrayWithObjects:@"关注动态",@"宝贝上新",@"视频直播",@"排行榜", nil];

        _moveView = [[UIView alloc]initWithFrame:CGRectMake(0, 64+48, WIDTH/4, 48)];

        [self.view addSubview:self.moveView];

        for (int i = 0; i< 4; i++) {

            _btn = [UIButton buttonWithType:UIButtonTypeRoundedRect];

            if (i==0)

            {

            [_btn setTitleColor:[UIColor orangeColor] forState:UIControlStateNormal];

            }else{

          [_btn setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];

            }

            _btn.tag = 200 +i;

            _btn.frame = CGRectMake(i*(WIDTH/4), 64, WIDTH/4, 48);

            [_btn setTitle:[btnTitArray objectAtIndex:i] forState:UIControlStateNormal];

            [_btn addTarget:self action:@selector(moveClick:) forControlEvents:UIControlEventTouchUpInside];

            [self.view addSubview:self.btn];

    相关文章

      网友评论

          本文标题:top滚动

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