Shows a faded gray color view through iOS 7 Navigation bar of a UISplitViewController

狂风中的少年 提交于 2019-12-07 16:10:37

问题


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,

Master View Controller:

- (void)viewDidLoad
{
    [super viewDidLoad];

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

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

Detail View Controller:

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

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

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

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.

But it is needed to add.

Any Idea. Please help.

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


回答1:


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.



来源:https://stackoverflow.com/questions/20512598/shows-a-faded-gray-color-view-through-ios-7-navigation-bar-of-a-uisplitviewcontr

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!