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

How to set NavigationBar's background color to gradient color?

$
0
0

Use the following code I only get black opaque background color for NavigationBar

[assembly: ExportRenderer (typeof (NavigationPage), typeof (TabbedNavigationRenderer))]
namespace DutyFreeCollection.iOS
{
    public class TabbedNavigationRenderer : NavigationRenderer
    {
        public TabbedNavigationRenderer ()
        {
            NavigationBar.BarStyle = UIBarStyle.Black;
            NavigationBar.Translucent = true;
            NavigationBar.BarTintColor = UIColor.FromRGBA (0f, 0f, 0f, 1f);
        }

        public override UIStatusBarStyle PreferredStatusBarStyle () {
            // Here is never reached
            return AppDelegate.Theme.StatusBarStyle;
        }
    }
}

Thank you.


Viewing all articles
Browse latest Browse all 58056

Trending Articles



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