码迷,mamicode.com
首页 > 其他好文 > 详细

按钮的上图片下文字排版

时间:2016-10-19 20:08:10      阅读:160      评论:0      收藏:0      [点我收藏+]

标签:

    self.rechargeButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;//使图片和文字水平居中显示

    [self.rechargeButton setTitleEdgeInsets:UIEdgeInsetsMake(self.rechargeButton.imageView.frame.size.height+10 ,-self.rechargeButton.imageView.frame.size.width, 0.0,0.0)];//文字距离上边框的距离增加imageView的高度,距离左边框减少imageView的宽度,距离下边框和右边框距离不变

    [self.rechargeButton setImageEdgeInsets:UIEdgeInsetsMake(-10, 0.0,0.0, -self.rechargeButton.titleLabel.bounds.size.width)];//图片距离右边框距离减少图片的宽度,其它不边

按钮的上图片下文字排版

标签:

原文地址:http://www.cnblogs.com/wang19941006/p/5978254.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!