![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
iOS UIButton
XLawsZero
这个作者很懒,什么都没留下…
展开
-
iOS UIButton的对齐方式
//让UIButton的title居右对齐 allButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight; //此时文字会紧贴到做边框,我们可以设置 allButton.contentEdgeInsets = UIEdgeInsetsMake(0,0,原创 2016-09-06 14:54:20 · 1048 阅读 · 0 评论 -
iOS UIButton 图片和文字上下居中
CGSize size1 = [titileArr[i] sizeWithFont:[UIFont systemFontOfSize:12] constrainedToSize:CGSizeMake(MAXFLOAT, self.button.titleLabel.frame.size.height)]; self.button.titleEdgeInsets =UIEdgeInse原创 2016-10-19 15:37:28 · 2289 阅读 · 0 评论 -
iOS UIButton运用EdgeInsets实现上图下文
-(void)setEdgeInsets:(UIButton *)button andImage:(UIImage *)image andTitle:(NSString *)titleStr { CGSize size = [titleStr boundingRectWithSize:CGSizeMake(MAXFLOAT, button.titleLabel.frame.size.h原创 2017-05-17 09:57:55 · 626 阅读 · 0 评论