0
我在我的iPhone應用程序,添加這樣的4個按鍵:如何使我的按鈕狀態選擇,直到下一個按鈕被選中?
UIImage *button1Image = [UIImage imageNamed:@"friends.png"];
button1 = [[UIButton buttonWithType:UIButtonTypeCustom] retain];
self.button1.tag=102;
[button1 setImage:button1Image forState:UIControlStateNormal];
[button1 setImage:[UIImage imageNamed:@"friends_hvr.png"] forState:UIControlStateSelected | UIControlStateHighlighted];
self.button1.frame = CGRectMake(90,5, 70,32);
[button1 addTarget:self action:@selector(friends:) forControlEvents:UIControlEventTouchUpInside];
我想使選定的一段時間讓我改變的背景選擇按鈕時,即我的按鈕狀態,直到選中下一個按鈕。但對我而言,它只是有時只是在眨眼。我需要堅持這一行動。我是這樣做的:
-(void)friends:(id)sender
{
[button1 setSelected:YES];
任何人都可以幫助我嗎?
當button2被選中時,你想要button1被取消選擇嗎?類似的東西? – Bazinga 2012-07-07 14:17:13