IOS开发之页面切换
生活随笔
收集整理的這篇文章主要介紹了
IOS开发之页面切换
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
從一個(gè)ViewController切換到另一個(gè)ViewController有下面幾種方法:
(1)addsubview方法切換視圖 self.view addSubview:(加載的新頁(yè)面); 相應(yīng)的?[self.view?removeFromSuperview];移除添加的view (2)self.view insertSubview:(加載的新頁(yè)面)?atIndex:n; 對(duì)n的解釋:頁(yè)面都是層次疊加的,n表示加載到那一層上面 (3)presentModalViewController方法????????photoNacController.modalTransitionStyle?=?UIModalTransitionStyleCrossDissolve;
?????photoNacController.modalPresentationStyle?=?UIModalPresentationFullScreen;
self?presentModalViewController:(加載的新頁(yè)面)?animated: modalTransitionStyle用于設(shè)置頁(yè)面切換的動(dòng)畫(huà) modalPresentationStyle用于設(shè)置視圖顯示的方式 兩種方法試試就知道用途了! (4)?pushViewController 導(dǎo)航 [self.navigationController?pushViewController:(加載的新頁(yè)面)?animated:YES]; 對(duì)應(yīng)的????????[self.navigationController?popViewControllerAnimated:YES];
?
轉(zhuǎn)載于:https://www.cnblogs.com/cynthia116/p/4494882.html
創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎(jiǎng)勵(lì)來(lái)咯,堅(jiān)持創(chuàng)作打卡瓜分現(xiàn)金大獎(jiǎng)總結(jié)
以上是生活随笔為你收集整理的IOS开发之页面切换的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 从简单的信道预计说起
- 下一篇: apache安装配置