2010-04-08 59 views
0

當您要求您設置您的博客時,如何在iPad中的其他視圖之上加載視圖,例如在wordpress應用中。你可以展示或張貼一些示例代碼。我有一個NSUSerdefaults設置,所以它會在第一次啓動時顯示。我希望這種看法看起來像這樣http://uplr.me/files/p45064.png如何在iPad的另一個視圖上加載視圖

看看它是如何有陰影和視圖是在背後變暗。那就是我想要做的。

回答

3

我得到了它

AddViewController* firstLaunchController = [[AddViewController alloc] initWithNibName:nil bundle:nil]; 
UINavigationController *modalNavigationController = [[UINavigationController alloc] initWithRootViewController:firstLaunchController]; 
modalNavigationController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; 
modalNavigationController.modalPresentationStyle = UIModalPresentationFormSheet; 
[detailViewController presentModalViewController:modalNavigationController animated:YES]; 
[firstLaunchController release]; 

是如此簡單,

謝謝大家

+1

感謝與我們分享您的代碼。 – 2010-04-09 20:08:20

2

第二個視圖是作爲第一個視圖的模態視圖加載的。見-[UIViewController presentModalViewController:animated:]

在iPad上,當您呈現模態視圖時,會自動變暗。

+0

我一直在使用WordPress的,從一些代碼嘗試,但不能得到它的任何工作。我使用這個現在 \t如果:{ \t \t CFirstLaunchViewController *筆尖= [[CFirstLaunchViewController頁頭] initWithNibName:無捆綁:無]([[NSUserDefaults的standardUserDefaults] boolForKey @ 「isFirstLaunch」]!); \t \t [window addSubview:nib.view]; \t \t nib.view.frame = CGRectMake(270,288,540,576); \t \t [筆尖發佈]; \t} 我需要做什麼。你能寫出我需要的代碼嗎 我對這個相當新穎01​​謝謝 – Frankrockz 2010-04-08 16:08:15

+0

你不'添加爲子視圖。您使用presentModalViewController:來代替。請注意,它是一個視圖控制器而不是視圖。請參閱http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instm/UIViewController/presentModalViewController:animated上的示例代碼: – TechZen 2010-04-08 19:42:36

相關問題