如何更改我的iPhone应用程序中的视图顺序?

时间:2011-03-11 05:31:41

标签: objective-c ios4 uiview

我创建了一个应用程序,但现在我已经在其中添加了一些其他视图,现在我想将新视图作为我的第一页.....是否可能?

2 个答案:

答案 0 :(得分:3)

您可能需要提供更多详细信息才能获得准确答案。假设您在包含UIView中有多个UIViews,需要注意以下几点:

的UIView:

- (void)bringSubviewToFront:(UIView *)view
- (void)sendSubviewToBack:(UIView *)view
- (void)insertSubview:(UIView *)view aboveSubview:(UIView *)siblingSubview
- (void)insertSubview:(UIView *)view atIndex:(NSInteger)index

答案 1 :(得分:0)

编辑您的AppDelegate.m文件

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {        
// Override point for customization after application launch.
// Add the view controller's view to the window and display.
[window addSubview:viewController.view1];//you may add view2, view3
[window makeKeyAndVisible];

return YES;

}