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


C# UITableView.RespondsToSelector方法代码示例

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


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

示例1: SWTableViewCell

        public SWTableViewCell(UITableViewCellStyle style, string reuseIdentifier,
            UITableView containingTable, IEnumerable<UIButton> rightUtilityButtons,
            UIView leftView, List<UIView> mainView)
            : base(style, reuseIdentifier)
        {
            scrollViewLeft = leftView;
            this.rightUtilityButtons = rightUtilityButtons.ToArray();
            scrollViewButtonViewRight = new SWUtilityButtonView(this.rightUtilityButtons, this);

            containingTableView = containingTable;
            height = (float)containingTableView.RowHeight;
            scrollViewDelegate = new SWScrollViewDelegate(this);

            // Check if the UITableView will display Indices on the right. If that's the case, add a padding
            if (containingTableView.RespondsToSelector(new Selector("sectionIndexTitlesForTableView:"))) {
                string[] indices = containingTableView.Source.SectionIndexTitles(containingTableView);
                additionalRightPadding = indices == null || indices.Length == 0 ? 0 : SectionIndexWidth;
            }

            // Set up scroll view that will host our cell content
            cellScrollView = new UIScrollView(new RectangleF(0, 0, (float)Bounds.Width, height));
            cellScrollView.ContentSize = new SizeF((float)Bounds.Width + UtilityButtonsPadding, height);
            cellScrollView.ContentOffset = ScrollViewContentOffset;
            cellScrollView.Delegate = scrollViewDelegate;
            cellScrollView.ShowsHorizontalScrollIndicator = false;
            cellScrollView.ScrollsToTop = false;
            var tapGestureRecognizer = new UITapGestureRecognizer(OnScrollViewPressed);
            cellScrollView.AddGestureRecognizer(tapGestureRecognizer);

            // Set up the views that will hold the utility buttons
            scrollViewLeft.Frame = new RectangleF(ScrollLeftViewWidth, 0, ScrollLeftViewWidth, height);
            cellScrollView.AddSubview(scrollViewLeft);

            scrollViewButtonViewRight.Frame = new RectangleF((float)Bounds.Width, 0, RightUtilityButtonsWidth, height);

            cellScrollView.AddSubview(scrollViewButtonViewRight);

            // Populate the button views with utility buttons
            scrollViewButtonViewRight.PopulateUtilityButtons();
            // Create the content view that will live in our scroll view
            scrollViewContentView = new UIView(new RectangleF(ScrollLeftViewWidth, 0, (float)Bounds.Width, height));
            cellScrollView.AddSubview(scrollViewContentView);
            this.mainView = mainView;
            BuildMainView();

            AddSubview(cellScrollView);
            HideSwipedContent(false);
        }
开发者ID:strongloop,项目名称:loopback-example-xamarin,代码行数:48,代码来源:SWTableViewCell.cs

示例2: SWTableViewCell

        public SWTableViewCell(UITableViewCellStyle style, string reuseIdentifier, 
		                        UITableView containingTable, IEnumerable<UIButton> rightUtilityButtons, 
		                        UIView leftView)
            : base(style, reuseIdentifier)
        {
            this.scrollViewLeft = leftView;
            this.rightUtilityButtons = rightUtilityButtons.ToArray();
            this.scrollViewButtonViewRight = new SWUtilityButtonView (this.rightUtilityButtons, this);

            this.containingTableView = containingTable;
            this.height = containingTableView.RowHeight;
            this.scrollViewDelegate = new SWScrollViewDelegate (this);

            // Check if the UITableView will display Indices on the right. If that's the case, add a padding
            if(containingTableView.RespondsToSelector(new MonoTouch.ObjCRuntime.Selector("sectionIndexTitlesForTableView:")))
            {
                var indices = containingTableView.Source.SectionIndexTitles (containingTableView);
                additionalRightPadding = indices == null || indices.Length == 0 ? 0 : SectionIndexWidth;
            }

            // Set up scroll view that will host our cell content
            this.cellScrollView = new UIScrollView (new RectangleF (0, 0, Bounds.Width, height)); //TODO:frames
            this.cellScrollView.ContentSize = new SizeF (Bounds.Width + this.UtilityButtonsPadding, height);//TODO:frames
            this.cellScrollView.ContentOffset = ScrollViewContentOffset;
            this.cellScrollView.Delegate = this.scrollViewDelegate;
            this.cellScrollView.ShowsHorizontalScrollIndicator = false;
            this.cellScrollView.ScrollsToTop = false;
            UITapGestureRecognizer tapGestureRecognizer = new UITapGestureRecognizer(OnScrollViewPressed);
            this.cellScrollView.AddGestureRecognizer (tapGestureRecognizer);

            // Set up the views that will hold the utility buttons
            this.scrollViewLeft.Frame = new RectangleF (ScrollLeftViewWidth, 0, ScrollLeftViewWidth, height);//TODO:frame
            this.cellScrollView.AddSubview (scrollViewLeft);

            this.scrollViewButtonViewRight.Frame = new RectangleF (Bounds.Width, 0, RightUtilityButtonsWidth, height); //TODO:frame
            this.cellScrollView.AddSubview (scrollViewButtonViewRight);

            // Populate the button views with utility buttons
            this.scrollViewButtonViewRight.PopulateUtilityButtons ();
            // Create the content view that will live in our scroll view
            this.scrollViewContentView = new UIView(new RectangleF(ScrollLeftViewWidth, 0, Bounds.Width, height));
            this.scrollViewContentView.BackgroundColor = UIColor.White;
            this.cellScrollView.AddSubview (this.scrollViewContentView);

            UIView contentViewParent;
            //deals with an internal change introduced in iOS 8
            if (UIDevice.CurrentDevice.CheckSystemVersion(8, 0)){
                contentViewParent = this;
            }
            else {
                // Add the cell scroll view to the cell
                contentViewParent = Subviews[0];
            }

            foreach (var subView in contentViewParent.Subviews) {
                this.scrollViewContentView.AddSubview (subView);
            }
            AddSubview (this.cellScrollView);

            HideSwipedContent (false);
        }
开发者ID:raghurana,项目名称:Xamarin-SWTableViewCell,代码行数:61,代码来源:SWTableViewCell.cs


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