UIButton上字体偏移

来源:互联网 发布:知名外汇交易商 知乎 编辑:程序博客网 时间:2024/05/21 07:11
当设置UIButton对其方式使用


       // [button setTitleEdgeInsets:UIEdgeInsetsMake(0, 15, 0, 0)];

       // button.titleLabel.textAlignment = UITextAlignmentLeft;

不起作用时,可以用

        

        button.contentHorizontalAlignment =UIControlContentHorizontalAlignmentLeft;

        button.contentEdgeInsets =UIEdgeInsetsMake(0,18, 0, 0);

        


原创粉丝点击