Пример #1
0
 /// <summary>
 /// Apply this theme to all views with the given appearance.
 /// </summary>
 /// <param name="options">
 /// "blue", or null
 /// </para>
 public static void Apply(UIBarButtonItem.UIBarButtonItemAppearance appearance, string options = null)
 {
     if (options == "blue")
     {
         appearance.SetBackgroundImage(blueBarButtonBackground.Value, UIControlState.Normal, UIBarMetrics.Default);
         appearance.SetBackButtonBackgroundImage(blueBackButtonBackBackground.Value, UIControlState.Normal, UIBarMetrics.Default);
     }
     else
     {
         appearance.SetBackgroundImage(barButtonBackground.Value, UIControlState.Normal, UIBarMetrics.Default);
         appearance.SetBackButtonBackgroundImage(backButtonBackBackground.Value, UIControlState.Normal, UIBarMetrics.Default);
     }
 }
Пример #2
0
        public static void Apply(UIBarButtonItem.UIBarButtonItemAppearance appearance, string options = null)
        {
            if (IsModern)
            {
                return;
            }

            var font = UIFont.FromName(BarButtonFontName, BarButtonFontSize);

            appearance.SetBackgroundImage(
                ButtonImage.Value,
                UIControlState.Normal,
                UIBarMetrics.Default);

            appearance.SetBackButtonBackgroundImage(
                BackButtonImage.Value,
                UIControlState.Normal,
                UIBarMetrics.Default);

            appearance.SetTitlePositionAdjustment(new UIOffset(0, 1), UIBarMetrics.Default);

            appearance.SetTitleTextAttributes(new UITextAttributes {
                TextColor        = BarTextColor,
                TextShadowColor  = BarButtonTextShadowColor,
                TextShadowOffset = BarButtonTextShadowOffset,
                Font             = font,
            }, UIControlState.Normal);

            appearance.SetTitleTextAttributes(new UITextAttributes {
                TextColor        = UIColor.FromWhiteAlpha(0.9f, 1),
                TextShadowColor  = BarButtonTextShadowColor,
                TextShadowOffset = BarButtonTextShadowOffset,
                Font             = font,
            }, UIControlState.Disabled);

            appearance.SetTitleTextAttributes(new UITextAttributes {
                TextColor        = UIColor.White,
                TextShadowColor  = BarButtonTextShadowColor,
                TextShadowOffset = BarButtonTextShadowOffset,
                Font             = font,
            }, UIControlState.Highlighted);
        }
 public static void Apply(UIBarButtonItem.UIBarButtonItemAppearance appearance, string options = null)
 {
     ConfirmTrackBeamTheme();
     ThemeManager.Current.Apply(appearance);
 }