Bug 38595 - Need way to change color of MasterDetailPage divider on iPad
Summary: Need way to change color of MasterDetailPage divider on iPad
Status: RESOLVED NOT_ON_ROADMAP
Alias: None
Product: Forms
Classification: Xamarin
Component: iOS ()
Version: 2.0.0
Hardware: Macintosh Mac OS
: Normal enhancement
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-02-09 19:39 UTC by Roger Peters
Modified: 2016-12-22 14:58 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Sample project showing inability to adjust the divider line color (118.95 KB, application/zip)
2016-02-09 19:39 UTC, Roger Peters
Details
Image showing line whose color needs to be changeable (18.13 KB, image/png)
2016-02-09 19:41 UTC, Roger Peters
Details
Updated sample project showing issue with divider line when drawer can be opened/closed (18.54 KB, application/zip)
2016-02-10 20:19 UTC, Roger Peters
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NOT_ON_ROADMAP

Description Roger Peters 2016-02-09 19:39:20 UTC
Created attachment 14971 [details]
Sample project showing inability to adjust the divider line color

There appears to be no way to customize the 1px divider shown on iPad on the MasterDetailPage which divides between the master and the detail views - it is always gray. This is very noticeable when making a dark themed app.

So far I have tried the following:

Create a custom TabletMasterDetailRenderer, and try to set any of the following:
this.MasterDetailPage.BackgroundColor
this.MasterDetailPage.Master.BackgroundColor
this.MasterDetailpage.Detail.BackgroundColor

The following forum thread suggests it is possible via a custom renderer as above, however it has no effect on an iPad (iOS 9.2) simulator:
https://forums.xamarin.com/discussion/comment/120160/#Comment_120160

Attached is a sample project. If you search for 'Lime' you will find all the ways I have tried to set the divider color with no luck. I will also attach a screenshot showing the line I am referring to.
Comment 1 Roger Peters 2016-02-09 19:41:18 UTC
Created attachment 14972 [details]
Image showing line whose color needs to be changeable
Comment 2 Roger Peters 2016-02-10 20:18:32 UTC
Upon further research a few discoveries were made:

1) Setting the divider color is done by simply setting the BackgroundColor for the MasterDetailPage - there is no need for a custom renderer

2) The divider is always gray on iPad if the drawer can be open/closed. This would be the case if the iPad is in portrait mode, or if MasterDetailPage.MasterBehavior is set to MasterBehavior.Popup so that the drawer can be open/closed in landscape

3) The only scenario where the divider color works reliably on iPad is in landscape mode with MasterDetailPage.MasterBehavior set as the default

I'll attach a new simple sample project to show these issues. The test project has a blue drawer, a red detail page, and sets the MasterDetailPage.BackgroundColor to black. It also has a custom renderer which sets the MasterDetailpage.BackgroundColor to green. You'll find that while both routes work when the drawer cannot be opened/closed, neither route works when the drawer can be opened/closed.
Comment 3 Roger Peters 2016-02-10 20:19:13 UTC
Created attachment 14989 [details]
Updated sample project showing issue with divider line when drawer can be opened/closed
Comment 4 adrianknight89 2016-11-28 00:08:05 UTC
I looked at this and could confirm that there doesn't seem to be a way to style the divider line. I think this is an iOS limitation rather than XF issue. It's strange that Apple has not provided an easy way to style the divider. I tried playing around with colors as well as adding subviews to different views. Nothing seemed to work.