【发布时间】:2015-10-09 10:46:02
【问题描述】:
在我最近的工作中,我使用 React-Native 组件作为 iOS 应用程序的视图部分。当我编写“完整的原生应用程序”时,假设我在视图上有按钮,我点击它,UINavigationController 会推送一个新的ViewController:
UIButton *btn=[[UIButton alloc]initWithFrame:CGRectMake(60, 60, 200, 60)];
btn.backgroundColor=[UIColor greenColor];
[btn setTitle:@"btn" forState:UIControlStateNormal];
[btn addTarget:self action:@selector(clickme:) forControlEvents:UIControlEventTouchUpInside];
...
- (void) clickme: (UIButton*) sender{
[self.navController pushViewController:ANOTHER_VIEW_CONTROLLER animated:YES];
}
所以我的问题是:如何在 React-Native 组件中做到这一点?
【问题讨论】:
标签: ios react-native