![](/img/trans.png)
[英]how to click on a button in the iphone application and link to a website
[英]how to click on a button in the iphone application and link to a second page within the app
我正在建立一個沒有導航欄的基於視圖的項目。 我有2頁。 只需一個按鈕即可從第一頁鏈接到第二頁。 然后是一個按鈕,用於從第二頁鏈接到第一頁。 似乎應該很簡單,但我有一段時間想得到它。
- (IBAction) view2ButtonPressed: (id) sender {
View2Controller *vc = [[View2Controller alloc] initWithNibName:@"View2" bundle:nil];
[self.navigationController pushViewController:vc animated:YES];
}
然后將按鈕的touchedUp操作鏈接到view2ButtonPressed方法。 (確保同時在.h文件中列出該方法)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.