摘要:
有同學(xué)在 CocoaChina 上提出這樣一個(gè)問題:A viewController 中包含一個(gè) B viewController(B 的 view 作為 A 的 view 的 subView),在橫豎屏轉(zhuǎn)換時(shí),A 可以得到屏幕旋轉(zhuǎn)相關(guān)的消息(如:shouldAutorotateToInterfaceOrientation),而 B 卻得不到,即使 A,B 都實(shí)現(xiàn)了這些函數(shù)。原貼見這里:http://www.cocoachina.com/bbs/read.php?tid=40973&page=1#393765
這個(gè)問題我以前也碰到過,稍微研究了一下,其原因是 A 是在 AppDelegate 里 window 的 controller 層次體系中(比如,是 navigation push進(jìn)去的等等),而 B 只是創(chuàng)建出來,讓 A 方便使用其 view 而已,B 并沒有加入這個(gè)層次體系中( B 的 parentViewController 為 nil,哪怕 B.view.superview 是 A.view)。所以 A 會(huì)跟著那個(gè)層次體系得到系統(tǒng)旋轉(zhuǎn)相關(guān)的消息,而 B 被涼在一邊, 閱讀全文
posted @ 2011-07-18 23:10
飄飄白云
閱讀(565)
評(píng)論(1)
推薦(0)
浙公網(wǎng)安備 33010602011771號(hào)