UIButton

UIButton *moreButton = [UIButton buttonWithType:UIButtonTypeCustom];

moreButton.frame = CGRectMake(1.0f,1.0f, cell.contentView.frame.size.width-2, cell.contentView.frame.size.height-2);

[moreButton.layer setMasksToBounds:YES];

[moreButton.layer setCornerRadius:10.0]; //设置矩形四个圆角半径

[moreButton.layer setBorderWidth:1.0]; //边框宽度

moreButton.backgroundColor = [UIColor clearColor];

一般创建button的方式,注意不是用alloc init的方式

2那里,在中点拉伸图片,不同的是imge是点size的,而不是点frame的,有意思吧,有空再研究了

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容