[英]How to replace an image in a button to remain as the new image after the button is pressed?
我正在創建一個游戲,用戶必須按下一個按鈕,當他按下按鈕時,按鈕的圖像應該永久改變......
- (IBAction)secondHintq:(id)sender {
hintView.text = @"Type in text here 2";
}
按鈕的出口被稱為:
candleChangeOne
這是怎么做的?
你可以試試這個:
- (IBAction)secondHintq:(id)sender
{
UIButton *button = sender;
[button setImage:[UIImage imageNamed:@"YourImage"]forState:UIControlStateNormal];
hintView.text = @"Type in text here 2";
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.