Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/116.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/hibernate/5.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 不在UI按钮上显示图像_Ios_Uibutton_Uiimage - Fatal编程技术网

Ios 不在UI按钮上显示图像

Ios 不在UI按钮上显示图像,ios,uibutton,uiimage,Ios,Uibutton,Uiimage,如果我不能正确地解释这个问题,请原谅我 通过使用xcode 4.6,我成功地在按钮上添加了图像,但当我尝试使用xcode 5.0.2在按钮上显示图像时,它没有正确地显示在按钮上 下面是我在按钮上添加图像的代码 [checkBtn1 setImage:[UIImage imageNamed:@"Checkmark_uncheckcheck.png"] forState:UIControlStateNormal]; [checkBtn2 setImage:[UIImage imageNamed:@"

如果我不能正确地解释这个问题,请原谅我

通过使用xcode 4.6,我成功地在按钮上添加了图像,但当我尝试使用xcode 5.0.2在按钮上显示图像时,它没有正确地显示在按钮上

下面是我在按钮上添加图像的代码

[checkBtn1 setImage:[UIImage imageNamed:@"Checkmark_uncheckcheck.png"] forState:UIControlStateNormal];
[checkBtn2 setImage:[UIImage imageNamed:@"Checkmark_uncheckcheck.png"] forState:UIControlStateNormal];
[checkBtn3 setImage:[UIImage imageNamed:@"Checkmark_uncheckcheck.png"] forState:UIControlStateNormal];
[checkBtn4 setImage:[UIImage imageNamed:@"Checkmark_uncheckcheck.png"] forState:UIControlStateNormal];
这就是它的样子:


看到屏幕截图后,我认为您使用的是roundrect按钮类型,将其设置为自定义和设置背景图像,而不是设置图像

UIButton * checkBtn1 =[UIButton buttonWithType:UIButtonTypeCustom];
[checkBtn1 setBackgroundImage:[UIImage imageNamed:@"Checkmark_uncheckcheck.png"] forState:UIControlStateNormal];

尝试SetImage的setBackground image Insetted用户信誉低于10这就是他无法显示图像的原因我无法发布快照,因为信誉较低,这是什么意思,然后它只在按钮上显示蓝色