嗨,我與iPad應用程序的工作
我想UISplitView加入的UIViewController,它應該是在編程方法 任何一個可以幫助我如何擺脫這種
我已經添加拆分視圖在一個UIWindow和工作正常,但我需要UISplitView添加到UIView的控制器, 當用戶點擊預先在主畫面按鈕,它去詳細查看和詳細信息視圖應該UISplitView
THXUISplitView在UIViewController中
0
A
回答
2
我建議MGSplitViewController。它有一個類似於常規API的API,但有許多額外功能。其中之一是能夠將其添加爲子視圖。
2
喜我是這樣做的可以幫助你。只要通過參數描述,你可以得到slpitview如你所願。
.H文件
#import <Foundation/Foundation.h>
@class AppDelegate;
@interface CustomSplitView : NSObject
{
AppDelegate *objAppDelegate;
}
+(UIView *) setSplitView : (UIViewController *)masterView : (UIViewController*)DetailView :(CGRect)frame;
+(void) changeSplitView:(UIViewController *)DetailView :(UINavigationController *)navigationController;
@end
.m文件
#import "CustomSplitView.h"
#import "AppDelegate.h"
@implementation CustomSplitView
//*********this return view addsubview on self.view
+(UIView *) setSplitView:(UIViewController *)masterView :(UIViewController *)DetailView :(CGRect)frame
{
objAppDelegate=(AppDelegate *)[[UIApplication sharedApplication] delegate] ;
objAppDelegate.objMasterView=masterView;
objAppDelegate.objDetailView=DetailView;
//Select navigation for every split view
UINavigationController *masterNavigationController = [[[UINavigationController alloc] initWithRootViewController:objAppDelegate.objMasterView] autorelease];
UINavigationController *detailNavigationController = [[[UINavigationController alloc] initWithRootViewController:objAppDelegate.objDetailView] autorelease];
;
objAppDelegate.objSplitView.delegate=objAppDelegate;
objAppDelegate.objSplitView.viewControllers = [NSArray arrayWithObjects:masterNavigationController, detailNavigationController ,nil];
objAppDelegate.objSplitView.view.frame=frame;
return (objAppDelegate.objSplitView.view);
}
+(void) changeSplitView:(UIViewController *)DetailView :(UINavigationController *)navigationController
{
objAppDelegate=(AppDelegate *)[[UIApplication sharedApplication] delegate] ;
UINavigationController *detailNavigationController = [[[UINavigationController alloc] initWithRootViewController:DetailView] autorelease];
objAppDelegate.objDetailView=detailNavigationController ;
// Update the split view controller's view controllers array.
// NSArray *viewControllers = [[NSArray alloc] initWithObjects:navigationController, objAppDelegate.objDetailView, nil];
// objAppDelegate.objSplitView.viewControllers= viewControllers;
objAppDelegate.objSplitView.viewControllers = [NSArray arrayWithObjects:navigationController, objAppDelegate.objDetailView ,nil];
}
@end
爲集拆分在家裏視圖
Masterview *objFirstView = [[Masterview alloc] initWithNibName:@"Masterview" bundle:nil];
appdel.masterDelegate = objFirstView;
Detailview *objSecondView = [[Detailview alloc]
initWithNibName:@"Detailview" bundle:nil];
UIView *objView=[CustomSplitView setSplitView:objFirstView :objSecondView :self.view.frame];
[self.view addSubview:objView];
[objFirstView release];
[objSecondView release];
相關問題
- 1. 在UISplitView中有一個UINavigation
- 2. 在Tabbarcontrol中旋轉UISplitview
- 3. UIToolbar在UISplitView應用
- 4. 在主視圖中添加subview在UISplitView
- 5. UISplitView與UINavigaionController detailView
- 6. 改變從uisplitview
- 7. UISplitView問題
- 8. UISplitView with SingleViewController
- 9. UISplitView與UITabbar
- 10. 更改UISplitView中的RootViewController
- 11. 的iOS(iPad版):在UISplitView
- 12. DetailView不是在UISplitView中創建的
- 13. 在UISplitView中重新載入MasterView iphone
- 14. UITableViewController在UIViewController中
- 15. 如何縮小UISplitView
- 16. UISplitview - 不是從appdelegate
- 17. UISplitview與UITabBar行爲
- 18. iPhone UITabBar到iPad UISplitView
- 19. 在主UiViewController中動態聲明子UiViewController
- 20. 的UIViewController在UIViewController中超過了界限
- 21. 如何在UIViewController中
- 22. 在UIViewController中的UICollectionView
- 23. 的UITableViewController在UIViewController中
- 24. 繼承在UIViewController中
- 25. UISplitView中的代表沒有被調用
- 26. 更改UISplitView中RootViewController的顏色
- 27. iPad MPMoviePlayerController UISplitView中的iOS 5.1問題
- 28. UISplitView showDetailViewController:不在設備上工作
- 29. UINavigationbar barTintColor不工作在UISplitview模板
- 30. UISplitview沒有被排在頂部