Shows a faded gray color view through iOS 7 Naviga

2019-05-12 15:12发布

问题:

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.