1.UIButton 设置图文上下结构 并规定图片大小
bt0.setTitle("AAA", for: UIControlState())
bt0.setImage(UIImage(named: "Icon.png"), for: .normal)
var titleSize:CGSize = bt0.titleLabel!.frame.size
bt0.titleEdgeInsets = UIEdgeInsetsMake(bt0.frame.height - 25, -bt0.frame.width, 0,0)
bt0.imageEdgeInsets = UIEdgeInsetsMake(-titleSize.height, 0, 25, -titleSize.width)
上左下右
网友评论