Esempio n. 1
0
        public static void SetToolbarStyle(
            this UINavigationBar navigationBar,
            bool dropShadow = true)
        {
            var stylizedStringAttributes = new StylizedStringAttributes(
                UIFont.FromName(IntroRust, 14),
                UIColor.White,
                0.5f,
                1f,
                StylizedStringCase.Upper,
                UITextAlignment.Center);

            navigationBar.Translucent = false;
            navigationBar.StandardAppearance.TitleTextAttributes = stylizedStringAttributes.StringAttributes;
            navigationBar.StandardAppearance.BackgroundColor     = UIColor.Blue;
            navigationBar.StandardAppearance.ShadowImage         = new UIImage();
            navigationBar.SetViewWithShadowStyle(2, 0.4f, 2.0, 2.0, UIColor.LightGray);

            if (!dropShadow)
            {
                navigationBar.StandardAppearance.ShadowColor = UIColor.Clear;
            }
        }