通过UISplitViewController的iOS 7导航栏显示褪色的灰色视图 [英] Shows a faded gray color view through iOS 7 Navigation bar of a UISplitViewController

查看:132
本文介绍了通过UISplitViewController的iOS 7导航栏显示褪色的灰色视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了一个测试iPad应用程序,其中只包含一个拆分视图。

I have written a test iPad app which contains only a split view.

我使用故事板设置拆分视图。我没有通过故事板对生成的拆分视图控制器进行任何修改。但是对主视图控制器和详细视图控制器进行了一些修改,如下所示,

I used the storyboard for set the split view. I did not do any modification to the generated split view controller by the storyboard. But did some modifications to the master view controller and the detail view controller as follow,

主视图控制器:

- (void)viewDidLoad
{
    [super viewDidLoad];

    ............

    if ([self respondsToSelector:@selector(edgesForExtendedLayout)])
    {
        self.edgesForExtendedLayout = UIRectEdgeNone;
    }
}

详细信息视图控制器:

- (void)viewDidLoad
{
    .....................

    if ([self respondsToSelector:@selector(edgesForExtendedLayout)])
    {
        self.edgesForExtendedLayout = UIRectEdgeNone;
    }

    [self.navigationController.navigationBar setBackgroundColor:[UIColor whiteColor]];
}

启动应用程序时,我注意到褪色视图的边缘出现在导航栏。当我没有为视图控制器设置edgesForExtendedLayout时,这个问题不存在。

When launch the app, I noticed that the edges of the faded view appear on the navigation bar. This issue is not exist when I do not set edgesForExtendedLayout for the view controllers.

但是需要添加。

任何想法。请帮助。

这是Apple文档提供的示例。这个问题也存在。 https:// developer .apple.com / LIBRARY / IOS / samplecode / Popovers / Introduction / Intro.html#// apple_ref / doc / uid / DTS40010436

This is an example which has provided by the Apple documentation. This issue is exist with it too. https://developer.apple.com/LIBRARY/IOS/samplecode/Popovers/Introduction/Intro.html#//apple_ref/doc/uid/DTS40010436

推荐答案

我不确定,因为我还在学习iOS开发,但我正在寻找一种方法来在显示单元格时删除TableView中默认的左,恼人的偏移量。谷歌搜索后,我发现这个答案 https://stackoverflow.com/a/18986158/3022883 ,如果你取消选择下底栏TabBar(底部)保持灰色。每次滚动时都会重复使用UITableViewController中的每个单元格,因为TabBar中的空格不用于显示单元格,我假设它是TableView的背景颜色。

I'm not sure, because I'm still learning iOS development but I'm searching for a way to removing the the default left, annoying, offset in a TableView when displaying cells. After googling, I found this answer https://stackoverflow.com/a/18986158/3022883 and if you unselect "Under Bottom Bars" the TabBar (bottom) stays grey. Each cell in a UITableViewController is reused every time you scroll, so since the space in the TabBar is not used to display a cell, I'm assuming that it's the background colour of the TableView.

这篇关于通过UISplitViewController的iOS 7导航栏显示褪色的灰色视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆