Ios UIButton外观更改披露太多为什么?如何避免呢?
因此,当我自定义我的按钮时,我会放置如下背景图像:Ios UIButton外观更改披露太多为什么?如何避免呢?,ios,uiappearance,appearance,customizing,Ios,Uiappearance,Appearance,Customizing,因此,当我自定义我的按钮时,我会放置如下背景图像: - (void) styleUIButtons { UIImage *buttonNormalBg = [[UIImage imageNamed:@"button_normal" ] stretchableImageWithLeftCapWidth:0 topCapHeight:0]; UIImage *buttonSelectedBgb = [[UIImage imageNamed:@"button_selected" ] s
- (void) styleUIButtons {
UIImage *buttonNormalBg = [[UIImage imageNamed:@"button_normal" ] stretchableImageWithLeftCapWidth:0 topCapHeight:0];
UIImage *buttonSelectedBgb = [[UIImage imageNamed:@"button_selected" ] stretchableImageWithLeftCapWidth:0 topCapHeight:0];
id appereance = [UIButton appearance];
[appereance setTintColor:self.mainNavigationBarTextColor];
[appereance setBackgroundImage:buttonNormalBg forState:UIControlStateNormal];
[appereance setBackgroundImage:buttonSelectedBgb forState:UIControlStateHighlighted];
}
但表中的披露指标却可怕地变成了一行。为什么会这样?我怎样才能避免呢?我自定义按钮是否有误?
LeftCapWidth:topCapHeight:
是可拉伸图像
改用。我复制了你的代码,图像对我来说很好。 我唯一需要添加的是一个框架
只有在没有背景图像的情况下,“淡色”才起作用。改变方法,但我看不出这会如何影响曝光指示器