UIButton

2021-11-02  本文已影响0人  林希品

场景一:上图下字

button.titleEdgeInsets =UIEdgeInsetsMake(.0, - button.imageView.bounds.size.width -10.0,.0, button.imageView.bounds.size.width);

button.imageEdgeInsets =UIEdgeInsetsMake(.0, button.titleLabel.bounds.size.width,.0, - button.titleLabel.bounds.size.width);

场景二:左字右图

button.titleEdgeInsets =UIEdgeInsetsMake(.0, - button.imageView.bounds.size.width -10.0,.0, button.imageView.bounds.size.width);

button.imageEdgeInsets =UIEdgeInsetsMake(.0, button.titleLabel.bounds.size.width,.0, - button.titleLabel.bounds.size.width);

场景二:左字右图

[button setSemanticContentAttribute:UISemanticContentAttributeForceRightToLeft];

button.imageEdgeInsets = UIEdgeInsetsMake(0, 3, 0, 35);

button添加阴影

        skipButton.layer.shadowOffset =  CGSizeMake(1, 1);

        skipButton.layer.shadowOpacity = 0.8;

        skipButton.layer.shadowColor =  [UIColor colorWithWhite:0 alpha:0.1].CGColor;

        skipButton.backgroundColor = [UIColor colorWithWhite:0 alpha:0.2];

上一篇 下一篇

猜你喜欢

热点阅读