@ Property (nonatomic, strong) UIButton * weiXinButton;
@ Property (nonatomic, strong) UIButton * phoneButton;
@ Property (nonatomic, assign) BOOL isClick;
{
[Super viewDidLoad];
// Self. view. backgroundColor = [UIColor redColor];
_ LandButton = [UIButton buttonWithType: UIButtonTypeCustom];
_ LandButton. frame = CGRectMake (150,100, 60, 60 );
[_ LandButton setBackgroundImage: [UIImage imageNamed: @ "after.jpg"] forState: UIControlStateNormal];
_ LandButton. tag= 110;
[_ LandButton addTarget: self action: @ selector (aa :) forControlEvents: UIControlEventTouchUpInside];
[Self. view addSubview: _ landButton];
_ WeiXinButton = [UIButton buttonWithType: UIButtonTypeCustom];
_ WeiXinButton. frame = CGRectMake (150,200, 60, 60 );
[_ WeiXinButton setBackgroundImage: [UIImage imageNamed: @ "before.jpg"] forState: UIControlStateNormal];
[_ WeiXinButton addTarget: self action: @ selector (aa :) forControlEvents: UIControlEventTouchUpInside];
_ WeiXinButton. tag = 111;
[Self. view addSubview: _ weiXinButton];
_ PhoneButton = [UIButton buttonWithType: UIButtonTypeCustom];
_ PhoneButton. frame = CGRectMake (150,300, 60, 60 );
[_ PhoneButton setBackgroundImage: [UIImage imageNamed: @ "before.jpg"] forState: UIControlStateNormal];
[_ PhoneButton addTarget: self action: @ selector (aa :) forControlEvents: UIControlEventTouchUpInside];
_ PhoneButton. tag= 112;
[Self. view addSubview: _ phoneButton];
}
_ IsClick = YES;
Switch (sender. tag ){
Case 110:
{
[_ LandButton setBackgroundImage: [UIImage imageNamed: @ "after.jpg"] forState: UIControlStateNormal];
[_ WeiXinButton setBackgroundImage: [UIImage imageNamed: @ "beafore.jpg"] forState: UIControlStateNormal];
[_ PhoneButton setBackgroundImage: [UIImage imageNamed: @ "before.jpg"] forState: UIControlStateNormal];
}
Break;
Case 111:
{
_ IsClick = YES;
[_ WeiXinButton setBackgroundImage: [UIImage imageNamed: @ "after.jpg"] forState: UIControlStateNormal];
[_ LandButton setBackgroundImage: [UIImage imageNamed: @ "before.jpg"] forState: UIControlStateNormal];
[_ PhoneButton setBackgroundImage: [UIImage imageNamed: @ "before.jpg"] forState: UIControlStateNormal];
}
Break;
Case 112:
{
_ IsClick = YES;
[_ PhoneButton setBackgroundImage: [UIImage imageNamed: @ "after.jpg"] forState: UIControlStateNormal];
[_ LandButton setBackgroundImage: [UIImage imageNamed: @ "before.jpg"] forState: UIControlStateNormal];
[_ WeiXinButton setBackgroundImage: [UIImage imageNamed: @ "before.jpg"] forState: UIControlStateNormal];
}
Break;
Default:
Break;
}
}