CheckBox选择框
来源:互联网 发布:网络摄像头直接接电脑 编辑:程序博客网 时间:2024/05/21 19:25
#import "EFSelectGasViewController.h"@interface EFSelectGasViewController ()@property (weak, nonatomic) IBOutlet UIButton *confromBtn;@property (weak, nonatomic) IBOutlet UILabel *firstLabel;@property (weak, nonatomic) IBOutlet UILabel *secondLabel;@property (weak, nonatomic) IBOutlet UILabel *thirdLabel;@property (weak, nonatomic) IBOutlet UILabel *forthLabel;@property (weak, nonatomic) IBOutlet UIButton *firstCheckBox;@property (weak, nonatomic) IBOutlet UIButton *secondCheckBox;@property (weak, nonatomic) IBOutlet UIButton *thirdCheckBox;@property (weak, nonatomic) IBOutlet UIButton *forthCheckBox;@property (weak, nonatomic) IBOutlet UITextField *gasNumTextField;@property (nonatomic, strong) NSArray *items;- (IBAction)confromBtnClick:(UIButton *)sender;- (IBAction)checkBoxClick:(UIButton *)sender;@end@implementation EFSelectGasViewController- (NSArray *)items { if (!_items) { _items = @[_firstCheckBox,_secondCheckBox,_thirdCheckBox,_forthCheckBox]; } return _items;}- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view from its nib.}- (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; [self items];}- (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated.}/*#pragma mark - Navigation// In a storyboard-based application, you will often want to do a little preparation before navigation- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { // Get the new view controller using [segue destinationViewController]. // Pass the selected object to the new view controller.}*/- (IBAction)confromBtnClick:(UIButton *)sender { [_delegate efSelectGasDelegate:[self.gasNumTextField.text intValue]]; [self.navigationController popViewControllerAnimated:true];}- (IBAction)checkBoxClick:(UIButton *)sender { for (UIButton * tmp in self.items) { tmp.selected = NO; } sender.selected = YES; if (sender.tag == 500) { self.firstLabel.textColor = [UIColor redColor]; self.secondLabel.textColor = [UIColor blackColor]; self.thirdLabel.textColor = [UIColor blackColor]; self.forthLabel.textColor = [UIColor blackColor]; [_delegate efSelectGasDelegate:20]; [self.navigationController popViewControllerAnimated:true]; } else if (sender.tag == 501) { self.secondLabel.textColor = [UIColor redColor]; self.firstLabel.textColor = [UIColor blackColor]; self.thirdLabel.textColor = [UIColor blackColor]; self.forthLabel.textColor = [UIColor blackColor]; [_delegate efSelectGasDelegate:50]; [self.navigationController popViewControllerAnimated:true]; } else if (sender.tag == 502) { self.thirdLabel.textColor = [UIColor redColor]; self.firstLabel.textColor = [UIColor blackColor]; self.secondLabel.textColor = [UIColor blackColor]; self.forthLabel.textColor = [UIColor blackColor]; [self.navigationController popViewControllerAnimated:true]; [_delegate efSelectGasDelegate:100]; } else if (sender.tag == 503) { self.forthLabel.textColor = [UIColor redColor]; self.firstLabel.textColor = [UIColor blackColor]; self.secondLabel.textColor = [UIColor blackColor]; self.thirdLabel.textColor = [UIColor blackColor]; [_delegate efSelectGasDelegate:150]; [self.navigationController popViewControllerAnimated:true]; } }@end
0 0
- CheckBox选择框
- 自定义checkbox的选择框
- checkbox复选框 全部选择、反向选择
- checkbox 选择
- Android布局(三)------选择框RadioGroup、CheckBox
- 复选框控件CheckBox(选择类控件)
- jquery checkbox选择框公用方法
- 如何实现一个checkbox选择框
- CheckBox选择框和文字设置间距
- Android 控件之五:CheckBox 选择框
- checkbox框的各种状态选择
- checkbox和radio的自定义选择框
- checkbox 复选框只选择一个
- 自定义checkbox选择框的样式
- 自定义checkbox选择框和全选功能
- 限定复选框(CheckBox)选择个数
- 修改CheckBox选择框、设置选择框颜色
- checkbox列表选择2
- 第1部分(必备知识)
- 拥抱 Android Studio 之一:从 ADT 到 Android Studio
- java爬虫入门
- 取浮点数或整数个位,百位...上的数
- 邮件开发:SMTP协议详解
- CheckBox选择框
- libevent的http服务与libjson结合
- get新技能: 查询API
- 用QT获取本机IP
- 觉得比较好的资料汇集
- 大数据学习之Scala中列表(List)的使用学习(5)
- linux下定时任务crontab的使用
- 对回调函数的一点理解
- C. Vanya and Scales (进制转换)