码迷,mamicode.com
首页 > 其他好文 > 详细

页面常见问题

时间:2015-06-07 09:49:23      阅读:125      评论:0      收藏:0      [点我收藏+]

标签:页面常见问题

一、页面跳转时停顿问题

在跳转后的页面添加背景色:[self.view setBackgroundColor:[UIColor colorWithRed:1.0f green:1.0f blue:1.0f alpha:1]];

二、页面布局被标题栏覆盖问题

- (id)init {

    self = [super init];

    if (self) {

        if ([self respondsToSelector:@selector(setEdgesForExtendedLayout:)]) {

            [self setEdgesForExtendedLayout:UIRectEdgeNone];

        }

        

        if ([self respondsToSelector:@selector(setExtendedLayoutIncludesOpaqueBars:)]) {

            [self setExtendedLayoutIncludesOpaqueBars:NO];

        }

        

        if ([self respondsToSelector:@selector(setModalPresentationCapturesStatusBarAppearance:)]) {

            [self setModalPresentationCapturesStatusBarAppearance:NO];

        }

        

        [self.view setBackgroundColor:RGBCOLOR(255, 255, 255)];

    }

    return self;

}



三、页面跳转

1、利用UINavigationController进行跳转

进入:[self.navigationController pushViewController myVC animated:ture;

返回:[self.navigationController popViewControllerAnimated:YES];

2、利用UIViewController自身的presentModalViewController进行跳转

进入:[self presentModalViewController myVC animated:YES];

返回:[self dismissModalViewControllerAnimated:YES];

四、appDelegate加载页面

self.window =[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];


ViewController *viewController = [[ViewController alloc] init];

navigationController = [[UINavigationController alloc] initWithRootViewController:viewController];

self.window.rootViewController = navigationController;

self.window.backgroundColor = [UIColor whiteColor];

[self.window makeKeyAndVisible];





页面常见问题

标签:页面常见问题

原文地址:http://blog.csdn.net/huanghaiyan_123/article/details/46390073

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!