-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[A] Check for parent NavigationPage when setting MDP detail's TopPadding #473
Conversation
@pauldipietro I think you need to add this check to Master as well if it's in splitscreen mode. In tablets for example, both master and detail could appear side by side. Add the same check to |
After this is merged, #422 should be reviewed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also this needs rebase..
@@ -116,7 +116,7 @@ void IVisualElementRenderer.SetElement(VisualElement element) | |||
{ | |||
_detailLayout = new MasterDetailContainer(newElement, false, Context) | |||
{ | |||
TopPadding = statusBarHeight, | |||
TopPadding = Element.Parent is NavigationPage ? 0 : statusBarHeight, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So what if Parent is not a Navigation, but something like TabbedPage, and that was as a parent a Navigation? Get me?
Nav -> Tab > MDP -> we don't like this in Forms, but in this case your fix doesn't work, maybe a recursive method to check if we have a Nav above us.
VerticalOptions = LayoutOptions.EndAndExpand, | ||
Children = | ||
{ | ||
new Label { Text = "This should be visible." } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a test to check if this text appears ?
18fca5a
to
1dbd12f
Compare
can you rebase @pauldipietro |
1dbd12f
to
93f4309
Compare
@rmarinho Done |
@rmarinho Was the master component tested in split screen/view mode? |
@adrianknight89 yes i tested! |
Needs rebase @pauldipietro |
93f4309
to
e9f08fd
Compare
This does not fix the problem for the Master when in "Split" mode. If someone needs a fix right now, (as horrible as it may be) just use the following renderer:
|
Description of Change
Additional top padding was being added onto a MasterDetailPage's detail when inside of a NavigationPage in AppCompat, presumably from the calculations that the NavigationPage itself was already doing. This additional status bar height being set as padding can be avoided by checking to see if the parent is a NavigationPage or not.
Gallery reproduction added, although it's a visual issue.
Bugs Fixed
https://bugzilla.xamarin.com/show_bug.cgi?id=44476
API Changes
None
Behavioral Changes
None
PR Checklist