UIButton *btn = (UIButton *)[cell viewWithTag:101];
btn.frame = CGRectMake(5, 5, 150, hei - 10);
[btn addTarget:self action:@selector(selectPic:) forControlEvents:UIControlEventTouchUpInside];
if ([indexPath section]==0) {
picture = [guangPicLeftArray objectAtIndex:[indexPath row]];
}else{
picture = [guangPicRightArray objectAtIndex:[indexPath row]];
}
[picView setImageWithURL:[NSURL URLWithString:picture.picUrl]];
[btn setImage:picView.image forState:UIButtonTypeCustom];
//begin
if (picture!=nil) {
[btnToPicDic setObject:picture forKey:btn.description];
NSLog(btn.description);
}
- (void)selectPic:(UIButton *)aBtn{
DetailViewController *detail = [[DetailViewController alloc]init];
detail.picture = [btnToPicDic objectForKey:aBtn.description];
[self presentModalViewController:detail animated:YES];
}
分享到:
相关推荐
UIButton+Badge,通过运行时的方式对UIButton拓展了标签展示功能 .
UIButton 的图文混排,就一个API 还可以在xib里面实现
uibutton的一些基本使用,简单的属性,再加一些封装
iphone中的基础控件UIButton扩展,自定义UICheckBox, 适合初学者,主要学习自定义UICheckBox的常用属性设置、点击事件、返回所有选中的box索引等
ios 自定义uibutton
UIButton,UILabel文字旋转(倾斜),UIButton,UILabel文字旋转(倾斜)
通过该类可以任意为UIView/UIButton等控件添加某条边的边框,包括边框大小和颜色
UIbutton培训学习代码
FSCustomButtonDemo 一个高度自定义UIButton控件,自定义按钮布局样式
UIButton中,默认title在右,image在左。然而很多情况下需要不同的布局,比如左右调换,上下布局。这边利用UIEdgeTitle和UIEdgeImage很好的解决了这种场景
CCAnimationBtn 一个UIButton子类,模仿抖音App中点赞按钮的动画效果
DFCountDownButton,继承UIButton,实现IOS倒计时按钮,用于注册等发送验证码的时候进行倒计时操作
UIButton使用方法汇总
一个按钮,添加手势,左右滑,给按钮不同的事件。
使用一句代码为UIbutton增加不同状态的配置(borderColor, titleLabelFont, backgroundColor,subView) 最新代码请移步github: https://github.com/spWang/UIButton-State 如果在使用过程中发现问题,请联系我,...
发送验证码 解决UIbutton闪烁 (一个按钮搞定) 更多欢迎关注: http://blog.csdn.net/u014220518?viewmode=list
一句代码设置UIButton的image和title的左右上下布局以及image和title的间距,git地址:https://github.com/Coder-ZJ/ZJCustomButton
一个小而灵活的UIButton子类,动画加载进度,完成动画
1、可任意调整图片对齐方式 2、显示位置 3、可以设置图片的大小 4、设置泡泡 5、点击状态变更 如有意见请留言,谢谢。
总结了Swift语言下的UIButton的常用方式,以及RxSwift+MVVM模式下UIButton的使用。