Bug 24500 - NavigationRenderer lays out views incorrectly with a translucent navigation bar
Summary: NavigationRenderer lays out views incorrectly with a translucent navigation bar
Status: RESOLVED ANSWERED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.2.3
Hardware: PC Mac OS
: Normal enhancement
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-11-13 14:08 UTC by Adam Kemp
Modified: 2018-02-12 18:16 UTC (History)
10 users (show)

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


Attachments
Example (7.59 MB, application/zip)
2014-11-13 14:08 UTC, Adam Kemp
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 ANSWERED

Description Adam Kemp 2014-11-13 14:08:10 UTC
Created attachment 8721 [details]
Example

This is similar to https://bugzilla.xamarin.com/show_bug.cgi?id=24484

If you make a custom renderer for a NavigatonPage and set the NavigationBar to translucent then the UINavigationController wants to lay out its children to fill the whole view, including underneath (z-order) the NavigationBar. The content of the child view controller should appear through the NavigationBar. The NavigationRenderer doesn't handle this properly. Instead of filling the whole view you end up with a view that is too short, but starts at the top. This leaves a blank area below the view (the size of the navigation bar plus the status bar).

The faulty code seems to be in NavigationRenderer.ViewDidLayoutSubviews, though I don't understand the code well enough to suggest the right fix.

See the attached project.
Comment 1 Adam Kemp 2014-11-13 14:28:43 UTC
See this discussion:
forums.xamarin.com/discussion/27745/navigationrender-issue
Comment 2 Rajneesh Kumar 2014-11-14 06:23:18 UTC
I have checked this issue and try to reproduce with the help and attached sample provided in the bug description and also the  discussion forms. 

Steps I have followed:

1. Open attached test application in XS.
2. Build, Set iOS as startup, and deploy it on simulator.
3. Observed that the Navigation bar with translucent
4. Also observed that, it leaves a blank area below the view.
5. Stop the application and open "NavigationPageRenderer.cs" file.
6. Comment line no 16 that is : "NavigationBar.Translucent = true;"
7. Build, and deploy the app again on simulator.
8. Observed that the Navigation bar with out translucent
9. Also observed that, it does not leave a blank area below the view and whole view is filled.

Screencast: http://www.screencast.com/t/cYnQEQPYIxc

Could you please confirmed that is this the same behavior as shown in screencast, experiencing you ? If no could you please let me know that what steps I am missing to reproduce this issue. or What steps should I follow to reproduce this issue. 

Also could you please provide us Ide logs, Build output, iOSDesiger logs. That will be very helpful to reproduce/investigate this issue at our end.   

You can get Ide and iOSDesigner log from here: Main Menu=>Help=>Open Log Directory 

Please let me know if I am missing anything?

Ide Logs: https://gist.github.com/Rajneesh360Logica/9dcbc9591faf80a60f9f

iOSDesigner logs: https://gist.github.com/Rajneesh360Logica/2e04683457998d52f4b8

App O/P: https://gist.github.com/Rajneesh360Logica/3098e6f4dc3045e3e3fd

Build O/P: https://gist.github.com/Rajneesh360Logica/b6e05467c5d304704e21

Environment Info:

=== Xamarin Studio ===

Version 5.5.3 (build 6)
Installation UUID: 1a096c6f-0678-402e-89b2-a2c10f7e80e4
Runtime:
	Mono 3.10.0 ((detached/e204655)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 310000023

=== Apple Developer Tools ===

Xcode 6.1 (6602)
Build 6A1052c

=== Xamarin.iOS ===

Version: 8.4.0.16 (Business Edition)
Hash: 80e9ff7
Branch: 
Build date: 2014-10-22 15:09:12-0400

=== Xamarin.Mac ===

Version: 1.10.0.18 (Business Edition)

=== Xamarin.Android ===

Version: 4.18.1 (Business Edition)
Android SDK: /Users/360_macmini/Desktop/android-sdk-macosx
	Supported Android versions:
		2.1    (API level 7)
		2.2    (API level 8)
		2.3    (API level 10)
		3.1    (API level 12)
		3.2    (API level 13)
		4.0    (API level 14)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
Java SDK: /usr
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

=== Build Information ===

Release ID: 505030006
Git revision: fbe3e9453daf6a3bb9a9709ed22bec35f7c9056b
Build date: 2014-10-23 13:08:38-04
Xamarin addins: e44add2b39de4dd57c0742bb2e620dfad84c64c6

=== Operating System ===

Mac OS X 10.9.4
Darwin ShrutiMac.local 13.3.0 Darwin Kernel Version 13.3.0
    Tue Jun  3 21:27:35 PDT 2014
    root:xnu-2422.110.17~1/RELEASE_X86_64 x86_64
Comment 3 Adam Kemp 2014-11-14 10:17:45 UTC
I can't watch your screencast because I don't have flash and refuse to install it again. Your description matches what I described in the bug report, and since you can reproduce the issue as described I think your logs are as good as mine.
Comment 4 Adam Kemp 2015-03-10 23:08:45 UTC
I'm not sure why this was marked as NEEDINFO. I believe you have all the information you need.
Comment 5 Jason Smith [MSFT] 2015-05-29 21:58:31 UTC
Thank you for the feature request. Not sure why this ended up NeedInfo either. This is in the feature request queue (actually already was). Thank you :)
Comment 6 Alexey Kinev 2015-07-06 09:24:26 UTC
Hmm... Navigation bar translucency could be considered "just feature" in 2013, but now more than 2 years has passed since it was originally introduced in iOS 7, and became common part of applications design.

Is it on roadmap?
Comment 7 Johan Karlsson 2015-07-23 02:31:16 UTC
This is a feature we really need, it's a deal breaker for one of my clients. It would be great if Xamarin could comment where this is on the roadmap.
Comment 8 John Miller [MSFT] 2015-08-14 08:16:12 UTC
In an effort to work around this, I added this to the LoginMenuPageRenderer.cs in the attached sample. 

public override void ViewDidLayoutSubviews ()
{
	base.ViewDidLayoutSubviews ();

	var frame = View.Frame;
	frame.Height = ParentViewController.View.Bounds.Height;
	View.Frame = frame;
}
Comment 9 Jason Smith [MSFT] 2016-03-25 18:18:11 UTC
Thank you for taking the time to submit this feature request. We like this idea and have added it to our internal feature tracking system.

Warm regards,
Xamarin Forms Team
Comment 10 Samantha Houts [MSFT] 2018-02-12 18:16:32 UTC
You can follow updates on https://github.com/xamarin/Xamarin.Forms/issues/1698. Thanks.