代码库> 按钮> DCHChangeStateButton
DCHChangeStateButton
关注
上传者:DCHRectina 分类:按钮(Button)
查看次数:1003 下载次数:225
上传时间:2017-11-21 大小:98 B
自定义一个菜单按钮,通过切换按钮状态,对列表数据进行排序,直接调用即可
for (int i = 0; i < titleArr.count; i++) {

UIView *view = [[UIView alloc] initWithFrame:CGRectMake(i*width, 64, width, 40)];
view.backgroundColor = [UIColor orangeColor]; DCHChangeStateButton *c sharePriceSortBtntitle:titleArr color:[UIColor whiteColor] font:[UIFont systemFontOfSize:14] target:self action:@selector(changeStateAction:)];
CGFloat btnW = [self calculateWidth:titleArr fontsize:14 labelH:88*mh]+28;
conditionBtn.frame = CGRectMake(0, 0, btnW, 88*mh);
conditionBtn.centerX = view.width*0.5;
conditionBtn.centerY = view.height*0.5;
conditionBtn.tag = i+1;
[view addSubview:conditionBtn];
[self.view addSubview:view];
[self.btnArr addObject:conditionBtn];
}
收藏
我来说两句
发表评论
您还没有登录!请登录注册
所有评论(0
提示