我用户界面生成器来定位叠加UIButton和UIImageView。 在代码中,更改按钮标签,如果存在图像UIButton标签不会出现在UIImageView上
在example.h文件
@property (strong, nonatomic) IBOutlet UIButton *takePicture;
@property (strong, nonatomic) IBOutlet UIImageView *image;
在Example.m
[self.image setImage:aPhoto];
(...)
NSString *pictureButtonTitle = [email protected]"Changer la photo":@"Ajouter une photo";
(...)
[self.takePicture setTitle:pictureButtonTitle forState:UIControlStateNormal];
我使用此代码为一个视图,我看“当myCondition为true时,在我的图片上正确更改图片“。 但在另一种观点,没有出现!为什么?
谢谢你,我喜欢你的方式! – 2015-04-03 12:07:56