(strong,nonatomic) IBOutlet UIButton *publishBtton;
(strong,nonatomic) IBOutlet UIButton *timeLineButton;
(strong,nonatomic) IBOutlet UIButton *chatButton;
(strong,nonatomic) IBOutlet UIButton *topicButton;
void)viewDidLoad
[superviewDidLoad];
_buttonArray=@[_publishBtton,_timeLineButton,_chatButton,_topicButton];
[_publishBttonsetImage:[UIImageimageNamed:@"publish"]forState:UIControlStateNormal];
[_timeLineButtonsetImage:[UIImageimageNamed:@"timeLineAfter"]forState:UIControlStateNormal];
[_chatButtonsetImage:[UIImageimageNamed:@"chatBefore"]forState:UIControlStateNormal];
[_chatButtonsetImage:[UIImageimageNamed:@"chatAfter"]forState:UIControlStateSelected];
[_topicButtonsetImage:[UIImageimageNamed:@"topicBefore"]forState:UIControlStateNormal];
[_topicButtonsetImage:[UIImageimageNamed:@"topicAfter"]forState:UIControlStateSelected];
void)changeButtonState:(UIButton *)button buttons:(NSArray *)buttonArray
for (UIButton* bin buttonArray)
selected=NO;
selected=YES;
//點擊按鈕事件
IBAction)changeView:(UIButton *)sender
[selfchangeButtonState:sender buttons:_buttonArray];
switch (sender.tag) {
case 400:
[_timeLineButtonsetImage:[UIImageimageNamed:@"timeLineBefore"]forState:UIControlStateNormal];
break;
[_timeLineButtonsetImage:[UIImageimageNamed:@"timeLineAfter"]forState:UIControlStateSelected];
[_timeLineButtonsetImage:[UIImageimageNamed:@"timeLineBefore"]forState:UIControlStateNormal];
break;
case 403:
[_timeLineButtonsetImage:[UIImageimageNamed:@"timeLineBefore"]forState:UIControlStateNormal];
break;
default:
break;