Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/103.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios UIButton外观更改披露太多为什么?如何避免呢?_Ios_Uiappearance_Appearance_Customizing - Fatal编程技术网

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:
是可拉伸图像


改用。

我复制了你的代码,图像对我来说很好。 我唯一需要添加的是一个框架


只有在没有背景图像的情况下,“淡色”才起作用。

改变方法,但我看不出这会如何影响曝光指示器