-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRootView.m
More file actions
executable file
·44 lines (37 loc) · 1.46 KB
/
Copy pathRootView.m
File metadata and controls
executable file
·44 lines (37 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//
// RootView.m
// HelpOrder
//
// Created by Ralbatr on 13-9-4.
// Copyright (c) 2013年 Ralbatr. All rights reserved.
//
#import "RootView.h"
@implementation RootView
-(id)initWithButtonTarget:(id)aTarget andSEL:(SEL)aSEL andOtherTarget:(id)otherTarget andOtherSEL:(SEL)otherSEL withFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self ShowButtonWithTarget:aTarget andSEL:aSEL andOtherTarget:otherTarget andOtherSEL:otherSEL ];
}
return self;
}
- (void)ShowButtonWithTarget:(id)aTarget andSEL:(SEL)aSEL andOtherTarget:(id)otherTarget andOtherSEL:(SEL)otherSEL
{
// 帮订餐 按钮
UIButton *orderButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
orderButton.frame = CGRectMake(20, 40, 280, 40);
[orderButton setTitle:@"帮订餐" forState:UIControlStateNormal];
[orderButton addTarget:aTarget action:aSEL forControlEvents:UIControlEventTouchUpInside];
orderButton.tag = 202;
[self addSubview:orderButton];
// 看清单 按钮
UIButton *checkButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
checkButton.frame = CGRectMake(20, 100, 280, 40);
[checkButton setTitle:@"看订单" forState:UIControlStateNormal];
[checkButton addTarget:otherTarget action:otherSEL forControlEvents:UIControlEventTouchUpInside];
checkButton.tag = 201;
//初始时,不可以使用查“看订单”按钮
[checkButton setEnabled:NO];
[self addSubview:checkButton];
}
@end