Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

No Title Bar on Android

$
0
0

Hi,

I have a sign in page where I do not want the Title Bar to appear on Android. But if I set the Activity's theme to one where the android:windowNoTitle property is true, or use RequestWindowFeature(WindowFeatures.NoTitle) in OnCreate, I get a NullReferenceException in SetPage(), with the following stack trace:

06-20 13:48:11.839 E/mono-rt ( 5979): [ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object
06-20 13:48:11.839 E/mono-rt ( 5979): at Xamarin.Forms.Platform.Android.Platform.SetActionBarBackground () [0x00000] in :0
06-20 13:48:11.839 E/mono-rt ( 5979): at Xamarin.Forms.Platform.Android.Platform.UpdateActionBarTint () [0x00000] in :0
06-20 13:48:11.839 E/mono-rt ( 5979): at Xamarin.Forms.Platform.Android.Platform.set_CurrentNavigationPage (Xamarin.Forms.NavigationPage value) [0x00000] in :0
06-20 13:48:11.839 E/mono-rt ( 5979): at Xamarin.Forms.Platform.Android.Platform.UpdateActionBar () [0x00000] in :0
06-20 13:48:11.839 E/mono-rt ( 5979): at Xamarin.Forms.Platform.Android.Platform.SetPage (Xamarin.Forms.Page newRoot) [0x00000] in :0
06-20 13:48:11.839 E/mono-rt ( 5979): at Xamarin.Forms.Platform.Android.AndroidActivity.SetPage (Xamarin.Forms.Page page) [0x00000] in :0

My current workaround is to call ActionBar.Hide() after SetPage(), but the title bar still appears for a second while the page is loading. Is there a property I can set on the Page to keep the title bar from ever appearing?

Thanks, Joe


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>