- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
//自定义UISplitViewController
UISplitViewController *splitController=[[UISplitViewController alloc] init];
//SplitDemoDetailViewController页面必需启用方向旋转功能
SplitDemoDetailViewController *rootController=[[SplitDemoDetailViewController alloc] init];
UINavigationController *nav=[[UINavigationController alloc] initWithRootViewController:rootController];
//UISplitViewController的详情页面
SplitDemo2ViewController *detailController=[[SplitDemo2ViewController alloc] init];
//设定UISplitViewController包含的页面
NSArray *arrControll=[NSArray arrayWithObjects:nav,detailController,nil];
splitController.viewControllers=arrControll;
//设定委托对象
splitController.delegate=detailController;
//把UISplitViewController添加到window中
self.window.rootViewController=splitController;
//释放对象
[rootController release];
[nav release];
[detailController release];
[splitController release];
[self.window makeKeyAndVisible];
return YES;
}
下载了一位达人自定义的UISplitViewController,灰常强,效果图片如下:
要demo下载:
http://dl.vmall.com/c0obw3n5hn