在網(wǎng)站制作中,頁(yè)面跳轉(zhuǎn)使用超鏈接,A標(biāo)簽,非常方便簡(jiǎn)單,但是在IOS APP開(kāi)發(fā)中就沒(méi)那么容易了,需要寫(xiě)比較多的代碼,方維網(wǎng)絡(luò)以下為你一一分享APP頁(yè)面跳轉(zhuǎn)方法全解。

一、 使用StoryBoard點(diǎn)擊按鈕直接跳轉(zhuǎn)到新頁(yè)面?
按住Ctrl鍵,拖動(dòng)連接線到目標(biāo)頁(yè)面,彈出窗口選擇modal 則為新頁(yè)面
如果要選擇push,則原頁(yè)面要實(shí)現(xiàn)Navigation導(dǎo)航
二、 利用Segue代碼跳轉(zhuǎn)
在起始頁(yè)面按住Ctrl鍵拖動(dòng)連接線到目標(biāo)頁(yè)面,彈出窗口選擇動(dòng)作類型,然后選中頁(yè)面連線,屬性框中命名Indetifier,然后中頁(yè)面代碼處需要跳轉(zhuǎn)地方使用
self.performSegueWithIdentifier ("CatSegue", sender: nil)
三、 代碼PUSH
let mainStoryboard = UIStoryboard(name: "Main", bundle: NSBundle.mainBundle())
let vc = mainStoryboard.instantiateViewControllerWithIdentifier("CategoryViewController") as! CategoryViewController
self.navigationController.pushViewController(vc, animated:true)
四、 代碼Modal
let mainStoryboard = UIStoryboard(name: "Main", bundle: NSBundle.mainBundle())
let vc = mainStoryboard.instantiateViewControllerWithIdentifier("CategoryViewController") as! CategoryViewController
self.presentViewController(vc, animated: true, completion: nil)
如沒(méi)特殊注明,文章均為方維網(wǎng)絡(luò)原創(chuàng),轉(zhuǎn)載請(qǐng)注明來(lái)自http://www.sdlwjx666.com/news/2852.html