#import "FirstViewController.h"
#import "fifthViewController.h"
@interface FirstViewController ()
@property (nonatomic,strong)UIButton *b1;
@property (nonatomic,strong)UIButton *b2;
@property (nonatomic,strong)UIButton *b3;
@property (nonatomic,strong)UIButton *b4;
@property (nonatomic,strong)UILabel *l1;
@property (nonatomic,strong)UILabel *l2;
@property (nonatomic,strong)UILabel *l3;
@property (nonatomic,strong)UILabel *l4;
@property (nonatomic,strong)UIButton *b5;
@property (nonatomic,strong)UIButton *b6;
@property (nonatomic,strong)UIButton *b7;
@property (nonatomic,strong)UIButton *b8;
@property (nonatomic,strong)UIButton *b9;
@property (nonatomic,strong)UIButton *b10;
@property (nonatomic,strong)UILabel *l5;
@property (nonatomic,strong)UILabel *l6;
@property (nonatomic,strong)UILabel *l7;
@property (nonatomic,strong)UIButton *b11;
@end
@implementation FirstViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.view.backgroundColor =[UIColor whiteColor];
//添加到视图
[self.view addSubview:self.b1];
[self.view addSubview:self.b2];
[self.view addSubview:self.b3];
[self.view addSubview:self.b4];
[self.view addSubview:self.l1];
[self.view addSubview:self.l2];
[self.view addSubview:self.l3];
[self.view addSubview:self.l4];
[self.view addSubview:self.b5];
[self.view addSubview:self.b6];
[self.view addSubview:self.b7];
[self.view addSubview:self.b8];
[self.view addSubview:self.b9];
[self.view addSubview:self.b10];
[self.view addSubview:self.l5];
[self.view addSubview:self.l6];
[self.view addSubview:self.l7];
[self.view addSubview:self.b11];
}
#pragma marc -------------button,label------
-(UIButton *)b1{
if (!_b1) {
_b1 =[[UIButton alloc]initWithFrame:CGRectMake(20, 70, 80, 80)];
[_b1 setImage:[UIImage imageNamed:@"i"] forState:UIControlStateNormal];
[_b1 addTarget:self action:@selector(anniu) forControlEvents:UIControlEventTouchUpInside];
}
return _b1;
}
-(UIButton *)b2{
if (!_b2) {
_b2 =[[UIButton alloc]initWithFrame:CGRectMake(120, 70, 80, 80)];
[_b2 setImage:[UIImage imageNamed:@"j"] forState:UIControlStateNormal];
[_b2 addTarget:self action:@selector(anniu) forControlEvents:UIControlEventTouchUpInside];
}
return _b2;
}
-(UIButton *)b3{
if (!_b3) {
_b3 =[[UIButton alloc]initWithFrame:CGRectMake(220, 70, 80, 80)];
[_b3 setImage:[UIImage imageNamed:@"k"] forState:UIControlStateNormal];
[_b3 addTarget:self action:@selector(anniu) forControlEvents:UIControlEventTouchUpInside];
}
return _b3;
}
-(UIButton *)b4{
if (!_b4) {
_b4 =[[UIButton alloc]initWithFrame:CGRectMake(320, 70, 80, 80)];
[_b4 setImage:[UIImage imageNamed:@"l"] forState:UIControlStateNormal];
[_b4 addTarget:self action:@selector(anniu) forControlEvents:UIControlEventTouchUpInside];
}
return _b4;
}
-(UILabel *)l1{
if (!_l1) {
_l1 =[[UILabel alloc]initWithFrame:CGRectMake(32, 130, 80, 30)];
_l1.text =@"正晚点";
}
return _l1;
}
-(UILabel *)l2{
if (!_l2) {
_l2 =[[UILabel alloc]initWithFrame:CGRectMake(132, 130, 80, 30)];
_l2.text =@"温馨服务";
}
return _l2;
}
-(UILabel *)l3{
if (!_l3) {
_l3 =[[UILabel alloc]initWithFrame:CGRectMake(232, 130, 80, 30)];
_l3.text =@"订单服务";
}
return _l3;
}
-(UILabel *)l4{
if (!_l4) {
_l4 =[[UILabel alloc]initWithFrame:CGRectMake(332, 130, 80, 30)];
_l4.text =@"约车";
}
return _l4;
}
//城市选择
-(UIButton *)b5{
if (!_b5) {
NSLog(@"111");
_b5 =[[UIButton alloc]initWithFrame:CGRectMake(60, 200, 60, 60)];
// [_b5 setImage:[UIImage imageNamed:@"i"] forState:UIControlStateNormal];
[_b5 setTitle:@"北京" forState:UIControlStateNormal];
[_b5 setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
// _b5.backgroundColor =[UIColor blueColor];
_b5.titleLabel.font = [UIFont systemFontOfSize:20];
[_b5 addTarget:self action:@selector(citychose) forControlEvents:UIControlEventTouchUpInside];
}
return _b5;
}
//交互
-(UIButton *)b6{
if (!_b6) {
_b6 =[[UIButton alloc]initWithFrame:CGRectMake(160, 200, 60, 60)];
[_b6 setImage:[UIImage imageNamed:@"111"] forState:UIControlStateNormal];
[_b6 addTarget:self action:@selector(jiaohu) forControlEvents:UIControlEventTouchUpInside];
}
return _b6;
}
//城市选择
-(UIButton *)b7{
if (!_b7) {
_b7 =[[UIButton alloc]initWithFrame:CGRectMake(260, 200, 60, 60)];
// [_b7 setImage:[UIImage imageNamed:@"i"] forState:UIControlStateNormal];
[_b7 setTitle:@"上海" forState:UIControlStateNormal];
[_b7 setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
_b7.titleLabel.font = [UIFont systemFontOfSize:20];
[_b7 addTarget:self action:@selector(citychose) forControlEvents:UIControlEventTouchUpInside];
}
return _b7;
}
//日期选择
-(UIButton *)b8{
if (!_b8) {
_b8 =[[UIButton alloc]initWithFrame:CGRectMake(40, 260, 100, 60)];
// [_b7 setImage:[UIImage imageNamed:@"i"] forState:UIControlStateNormal];
[_b8 setTitle:@"出发日期" forState:UIControlStateNormal];
[_b8 setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
_b8.titleLabel.font = [UIFont systemFontOfSize:15];
[_b8 addTarget:self action:@selector(datechose) forControlEvents:UIControlEventTouchUpInside];
}
return _b8;
}
-(UILabel *)l5{
if (!_l5) {
_l5=[[UILabel alloc]initWithFrame:CGRectMake(200, 260, 100, 60)];
_l5.text =@"2017-10-21";
}
return _l5;
}
//时间选择
-(UIButton *)b9{
if (!_b9) {
_b9 =[[UIButton alloc]initWithFrame:CGRectMake(40, 320, 100, 60)];
// [_b7 setImage:[UIImage imageNamed:@"i"] forState:UIControlStateNormal];
[_b9 setTitle:@"出发时间" forState:UIControlStateNormal];
[_b9 setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
_b9.titleLabel.font = [UIFont systemFontOfSize:15];
[_b9 addTarget:self action:@selector(datechose) forControlEvents:UIControlEventTouchUpInside];
}
return _b9;
}
-(UILabel *)l6{
if (!_l6) {
_l6=[[UILabel alloc]initWithFrame:CGRectMake(200, 320, 100, 60)];
_l6.text =@"0:00-24:00";
}
return _l6;
}
//席别
-(UIButton *)b10{
if (!_b10) {
_b10 =[[UIButton alloc]initWithFrame:CGRectMake(40, 380, 100, 60)];
// [_b7 setImage:[UIImage imageNamed:@"i"] forState:UIControlStateNormal];
[_b10 setTitle:@"席 别" forState:UIControlStateNormal];
[_b10 setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
_b10.titleLabel.font = [UIFont systemFontOfSize:15];
[_b10 addTarget:self action:@selector(datechose) forControlEvents:UIControlEventTouchUpInside];
}
return _b10;
}
-(UILabel *)l7{
if (!_l7) {
_l7=[[UILabel alloc]initWithFrame:CGRectMake(200, 380, 100, 60)];
_l7.text =@"不限";
}
return _l7;
}
-(UIButton *)b11{
if (!_b11) {
_b11 =[[UIButton alloc]initWithFrame:CGRectMake(150, 440, 100, 50)];
[_b11 setTitle:@"查询" forState:UIControlStateNormal];
_b11.backgroundColor =[UIColor blueColor];
[_b11 addTarget:self action:@selector(chaxun) forControlEvents:UIControlEventTouchUpInside];
}
return _b11;
}
#pragma marc --------------按钮方法-------
//按钮方法
-(void)anniu{
}
//城市选择
-(void)citychose{
}
//交互方法
-(void)jiaohu{
[_b5 setTitle:@"上海" forState:UIControlStateNormal];
[_b7 setTitle:@"北京" forState:UIControlStateNormal];
}
//日期选择方法
-(void)datechose{
}
//查询
-(void)chaxun{
fifthViewController *thefif =[[fifthViewController alloc]init];
[self.navigationController pushViewController:thefif animated:YES];
}
网友评论