Commit 9e00f5cf authored by 余玠's avatar 余玠

add button

parent f29b6429
...@@ -27,9 +27,22 @@ ...@@ -27,9 +27,22 @@
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
self.view.backgroundColor = [UIColor grayColor]; self.view.backgroundColor = [UIColor grayColor];
self.flutterContainer.view.frame = CGRectInset(self.view.bounds, 30, 50); self.flutterContainer.view.frame = CGRectInset(self.view.bounds, 30, 100);
[self.view addSubview:self.flutterContainer.view]; [self.view addSubview:self.flutterContainer.view];
[self addChildViewController:self.flutterContainer]; [self addChildViewController:self.flutterContainer];
UIButton *nativeButton = [UIButton buttonWithType:UIButtonTypeCustom];
nativeButton.frame = CGRectMake(50,self.view.bounds.size.height-50,200,40);
nativeButton.backgroundColor = [UIColor blueColor];
[nativeButton setTitle:@"Button in Native" forState:UIControlStateNormal];
[nativeButton addTarget:self action:@selector(pushMe) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:nativeButton];
}
- (void)pushMe
{
UIViewController *vc = [[UIViewController alloc] init];
[self.navigationController pushViewController:vc animated:YES];
} }
- (void)viewDidAppear:(BOOL)animated{ - (void)viewDidAppear:(BOOL)animated{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment