views:

493

answers:

7

When using UISplitViewController on the iPad there's a black vertical divider line between the root and detail view. Is there any way to remove this line?

Thanks

A: 

I did this accidentally by setting the backgroundColor property of the first viewController's view - possibly to clearColor, I don't remember now.

Paul Lynch
This did not work.
Sam Soffes
+2  A: 

I'm curious to see how the app reviewers are going to handle this. Before I invest heavily in taking away the divider, I would consult the HIG for iPad to make sure, and then ask the reviewers themselves. I can tell you from experience they are more strict on the iPad requirements than the iPhone, and that's saying a lot.

DysonApps
You are very right. The black line is meant to be there to separate the two panes and if that is the only change you are making then Apple may frown on it. I have seen apps rejected for futzing with a "known UI element" like this when you are simply changing an aspect of the iPhoneOS design 'cos you don't like it. Apple would probably consider this in the same vein that they do when you change the height of the tabbar to only show the icons, etc.
Jann
A: 

Has anyone found a solution or workaround to this?

Tilo Mitra
A: 

I looked around for a while, and came to the conclusion that theres no way to do this, other than to create your own custom split view.

macatomy
A: 

You can mostly get rid of it by setting another image behind it in the main window's views. This is from the app delegate didFinishLaunchingWithOptions

// Add the split view controller's view to the window and display.
splitViewController.view.opaque = NO;
splitViewController.view.backgroundColor = [UIColor clearColor];
[window addSubview:splitViewController.view];
[window insertSubview:bgImageView belowSubview:splitViewController.view];
[window makeKeyAndVisible];

But it still leaves two visual artifacts at the top and the bottom that appear to be custom drawn by the splitviewcontroller.

Dylan
A: 

I think it's better not to use the UISplitViewController if you want to customize it.

You can't really customize its width because it's set to 320.

I would rather create two views and handle the resizing.

As somebody else pointed out, if you try to hide the left column and display the full detail, I found out it leaves a pixel on the top and bottom on the divider column (bug?).

Simone Maynard
A: 

Interestingly, In the app that I'm working on I want a black background color for both views in the UISplitViewController. I'd like to change the color of the divider line to white (so that you can see it). Making both background colors black is one way to get rid of (make invisible) the dividing line but that's probably not a solution for most people.

hyperspasm
I just figured out how to change the color of the divider, eg. [[mySplitViewController view] setBackgroundColor:[UIColor whiteColor]];
hyperspasm