本文整理汇总了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);
}
示例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);
}