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


C# UISegmentedControl.SetDividerImage方法代码示例

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


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

示例1: TTTProfileIconTableViewCell

        public TTTProfileIconTableViewCell(UITableViewCellStyle style, string reuseIdentifier)
            : base(style, reuseIdentifier)
        {
            UIImage x = TTTProfile.ImageForIcon (TTTProfileIcon.X).
                ImageWithRenderingMode (UIImageRenderingMode.AlwaysOriginal);
            UIImage o = TTTProfile.ImageForIcon (TTTProfileIcon.O).
                ImageWithRenderingMode (UIImageRenderingMode.AlwaysOriginal);

            SegmentedControl = new UISegmentedControl (new object[] { x, o }) {
                Frame = new RectangleF (UIScreen.MainScreen.Bounds.Width / 2 - 120, 0, 240, 80),
                AutoresizingMask = UIViewAutoresizing.FlexibleTopMargin |
                    UIViewAutoresizing.FlexibleBottomMargin
            };
            UIEdgeInsets capInsets = new UIEdgeInsets (6f, 6f, 6f, 6f);
            SegmentedControl.SetBackgroundImage (
                UIImage.FromBundle ("segmentBackground").CreateResizableImage (capInsets),
                UIControlState.Normal, UIBarMetrics.Default);
            SegmentedControl.SetBackgroundImage (
                UIImage.FromBundle ("segmentBackgroundHighlighted").CreateResizableImage (capInsets),
                UIControlState.Highlighted, UIBarMetrics.Default);
            SegmentedControl.SetBackgroundImage (
                UIImage.FromBundle ("segmentBackgroundSelected").CreateResizableImage (capInsets),
                UIControlState.Selected, UIBarMetrics.Default);
            SegmentedControl.SetDividerImage (
                UIImage.FromBundle ("segmentDivider"), UIControlState.Normal,
                UIControlState.Normal, UIBarMetrics.Default);

            UIView containerView = new UIView (SegmentedControl.Frame) {
                Frame = ContentView.Bounds,
                AutoresizingMask =
                UIViewAutoresizing.FlexibleWidth |
                UIViewAutoresizing.FlexibleHeight
            };
            containerView.AddSubview (SegmentedControl);

            ContentView.AddSubview (containerView);
        }
开发者ID:BoogieMAN2K,项目名称:monotouch-samples,代码行数:37,代码来源:TTTProfileViewController.cs

示例2: TabButtonView

        public TabButtonView(RectangleF frame, params string[] tabs)
        {
            this.Frame = frame;

            _segment = new UISegmentedControl(tabs);
            _segment.ControlStyle = UISegmentedControlStyle.Bar;
            _segment.SelectedSegment = 0;
            _segment.AutosizesSubviews = true;
            _segment.AutoresizingMask = UIViewAutoresizing.FlexibleWidth;
            _segment.Frame = this.Frame;

            //Themeing
            var textAttrs = new UITextAttributes { TextColor = UIColor.FromRGB(122, 122, 122), TextShadowColor = UIColor.White, TextShadowOffset = new UIOffset(0, 1) };
            _segment.SetTitleTextAttributes(textAttrs, UIControlState.Normal);
            //var textAttrsHighlighted = new UITextAttributes { TextColor = UIColor.White, TextShadowColor = UIColor.FromRGB(122, 122, 122), TextShadowOffset = new UIOffset(0, 1) };
            //_segment.SetTitleTextAttributes(textAttrsHighlighted, UIControlState.Highlighted);

            _segment.SetDividerImage(Images.Components.TabsVertical, UIControlState.Normal, UIControlState.Normal, UIBarMetrics.Default);
            _segment.SetBackgroundImage(Images.Components.TabsBackground, UIControlState.Normal, UIBarMetrics.Default);
            _segment.SetBackgroundImage(Images.Components.TabsHighlighted, UIControlState.Selected, UIBarMetrics.Default);

            AddSubview(_segment);

            _segment.ValueChanged += (sender, e) => {
                if (SegmentChanged != null)
                    SegmentChanged(_segment.SelectedSegment);
            };

            //            //Fucking bug in the divider
            //            BeginInvokeOnMainThread(delegate {
            //                _segment.SelectedSegment = 1;
            //                _segment.SelectedSegment = 0;
            //                _segment.SelectedSegment = MonoTouch.Utilities.Defaults.IntForKey(MultipleSelectionsKey);
            //                Title = GetTitle(_segment.SelectedSegment);
            //
            //            });
        }
开发者ID:sergii-tkachenko,项目名称:Gistacular,代码行数:37,代码来源:TabButtonView.cs

示例3: StyleSegmentedControl

 public static void StyleSegmentedControl(string style, UISegmentedControl control)
 {
     control.SetBackgroundImage (UIArtwork[String.Format("{0}_unsel", style)], UIControlState.Normal, UIBarMetrics.Default);
     control.SetBackgroundImage (UIArtwork[String.Format("{0}_sel", style)], UIControlState.Selected, UIBarMetrics.Default);
     control.SetDividerImage (UIArtwork[String.Format("{0}_unsel_unsel", style)], UIControlState.Normal, UIControlState.Normal,	UIBarMetrics.Default);
     control.SetDividerImage (UIArtwork[String.Format("{0}_sel_unsel", style)],
         UIControlState.Selected,
         UIControlState.Normal,
         UIBarMetrics.Default
     );
     control.SetDividerImage (
         UIArtwork[String.Format("{0}_unsel_sel", style)],
         UIControlState.Normal,
         UIControlState.Selected,
         UIBarMetrics.Default
     );
 }
开发者ID:cwenham,项目名称:SpendingConsequences,代码行数:17,代码来源:ArtRepository.cs


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