我用戶界面生成器來定位疊加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