当前位置: 首页>>代码示例>>C#>>正文


C# UIColor.Darken方法代码示例

本文整理汇总了C#中UIColor.Darken方法的典型用法代码示例。如果您正苦于以下问题:C# UIColor.Darken方法的具体用法?C# UIColor.Darken怎么用?C# UIColor.Darken使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UIColor的用法示例。


在下文中一共展示了UIColor.Darken方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetBarButtonItemAppearance

        public static void SetBarButtonItemAppearance(UIBarButtonItem.UIBarButtonItemAppearance appearance, UIColor color, UIColor highlightedColor, UIColor textColor, float cornerRadius, float borderWidth)
        {
            UIImage backButtonPortraitImage = FlatUI.BackButtonImage(color,
                                                                     UIBarMetrics.Default,
                                                                     cornerRadius,
                                                                     color.Darken(2),
                                                                     borderWidth);
            UIImage highlightedBackButtonPortraitImage = FlatUI.BackButtonImage(highlightedColor,
                                                                                UIBarMetrics.Default,
                                                                                cornerRadius,
                                                                                highlightedColor.Darken(2),
                                                                                borderWidth);
            UIImage backButtonLandscapeImage = FlatUI.BackButtonImage(color,
                                                                      UIBarMetrics.LandscapePhone,
                                                                      cornerRadius,
                                                                      color.Darken(2),
                                                                      borderWidth);
            UIImage highlightedBackButtonLandscapeImage = FlatUI.BackButtonImage(highlightedColor,
                                                                                 UIBarMetrics.LandscapePhone,
                                                                                 cornerRadius,
                                                                                 highlightedColor.Darken(2),
                                                                                 borderWidth);

            appearance.SetBackButtonBackgroundImage(backButtonPortraitImage, UIControlState.Normal, UIBarMetrics.Default);
            appearance.SetBackButtonBackgroundImage(backButtonLandscapeImage, UIControlState.Normal, UIBarMetrics.LandscapePhone);
            appearance.SetBackButtonBackgroundImage(highlightedBackButtonPortraitImage, UIControlState.Highlighted, UIBarMetrics.Default);
            appearance.SetBackButtonBackgroundImage(highlightedBackButtonLandscapeImage, UIControlState.Highlighted, UIBarMetrics.LandscapePhone);

            appearance.SetBackButtonTitlePositionAdjustment(new UIOffset(1f, 1f), UIBarMetrics.Default);
            appearance.SetBackButtonTitlePositionAdjustment(new UIOffset(1f, 1f), UIBarMetrics.LandscapePhone);

            UIImage buttonImageNormal = FlatUI.Image(color, cornerRadius, color.Darken(2), borderWidth);
            UIImage buttonImageHighlighted = FlatUI.Image(highlightedColor, cornerRadius, highlightedColor.Darken(2), borderWidth);

            appearance.SetBackgroundImage(buttonImageNormal, UIControlState.Normal, UIBarMetrics.Default);
            appearance.SetBackgroundImage(buttonImageHighlighted, UIControlState.Highlighted, UIBarMetrics.Default);

            UITextAttributes titleTextAttributes = appearance.GetTitleTextAttributes(UIControlState.Normal);
            if (titleTextAttributes == null)
                titleTextAttributes = new UITextAttributes();
            titleTextAttributes.TextShadowColor = UIColor.Clear;
            titleTextAttributes.TextShadowOffset = new UIOffset(0, 0);
            titleTextAttributes.TextColor = textColor;
            titleTextAttributes.Font = FlatUI.FontOfSize(0);
            appearance.SetTitleTextAttributes(titleTextAttributes, UIControlState.Normal);
            appearance.SetTitleTextAttributes(titleTextAttributes, UIControlState.Highlighted);
        }
开发者ID:natecook1000,项目名称:FlatUIKit.Xamarin,代码行数:47,代码来源:FlatUI.cs

示例2: FUIButton

        //UIEdgeInsets DefaultEdgeInsets, NormalEdgeInsets, HighlightedEdgeInsets;

        public FUIButton(RectangleF frame, UIColor buttonColor, UIColor highlightedColor, float borderWidth = 1f, float cornerRadius = 5f)
            : this(frame, buttonColor, highlightedColor, buttonColor.Darken(2), highlightedColor.Darken(2), borderWidth, cornerRadius)
        {
        }
开发者ID:natecook1000,项目名称:FlatUIKit.Xamarin,代码行数:6,代码来源:FUIButton.cs


注:本文中的UIColor.Darken方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。