本文整理汇总了C#中UIButton.InsertSubviewAbove方法的典型用法代码示例。如果您正苦于以下问题:C# UIButton.InsertSubviewAbove方法的具体用法?C# UIButton.InsertSubviewAbove怎么用?C# UIButton.InsertSubviewAbove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UIButton
的用法示例。
在下文中一共展示了UIButton.InsertSubviewAbove方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ViewDidLoad
public override void ViewDidLoad()
{
base.ViewDidLoad();
AppDelegate.NavigationBar.SetBackButtonOn(this);
// Initialize the alternate list selector
_listView = new SeriesListViewController(this);
_listView.View.AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth;
_listView.View.Frame = new RectangleF(0, 0, View.Frame.Width, View.Frame.Height);
// Initialize the art gallery (already in background)
_galleryView = new SeriesGalleryViewController(this, _listView);
_galleryView.View.AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth;
_galleryView.View.Frame = new RectangleF(0, 0, View.Frame.Width, View.Frame.Height);
// http://stackoverflow.com/questions/1718495/why-does-viewdidappear-not-get-triggered
this.View.AddSubview(AppGlobal.CollectionsViewInListMode ? _listView.View : _galleryView.View);
// http://www.grokkingcocoa.com/a-simple-way-to-animate-a-u.html
// http://ykyuen.wordpress.com/2010/06/11/iphone-adding-image-to-uibarbuttonitem/
var listViewImage = UIImage.FromBundle("Images/gallery/listView.png");
var listViewImageHighlighted = UIImage.FromBundle("Images/gallery/listViewHighlighted.png");
_buttonFrame = new RectangleF(0, 0, 29, 30);
_buttonListThumb = new UIImageView(listViewImage);
listViewImage.Dispose();
_buttonListThumb.Frame = _buttonFrame;
_buttonListThumb.Hidden = AppGlobal.CollectionsViewInListMode;
var buttonListHighlight = new UIImageView(listViewImageHighlighted);
listViewImageHighlighted.Dispose();
buttonListHighlight.Frame = _buttonFrame;
// Build a thumbnail button for the selected page's piece
// TODO duplicate with code to select a piece in the list view
// TODO shouldn't have to size something from a factory method!
var thumb0 = ImageFactory.LoadRoundedThumbnail(_series.Pieces[_page]);
var thumb1 = ImageHelper.ImageToFitSize(thumb0, _listViewImageSize);
thumb0.Dispose();
_buttonGalleryThumb = new UIImageView(thumb1);
thumb1.Dispose();
_buttonGalleryThumb.Hidden = !AppGlobal.CollectionsViewInListMode;
_buttonGalleryThumb.Frame = _buttonFrame;
// Wire up the flip button
_buttonInner = UIButton.FromType(UIButtonType.Custom);
_buttonInner.UserInteractionEnabled = true;
_buttonInner.Bounds = _buttonListThumb.Bounds;
_buttonInner.AddSubview(_buttonListThumb);
_buttonInner.AddSubview(_buttonGalleryThumb);
_buttonInner.AddTarget(delegate {
_buttonInner.InsertSubviewAbove(_buttonListThumb, buttonListHighlight);
buttonListHighlight.RemoveFromSuperview();
Flip();
}, UIControlEvent.TouchUpInside);
_buttonInner.AddTarget(delegate {
_buttonInner.InsertSubviewAbove(_buttonListThumb, buttonListHighlight);
buttonListHighlight.RemoveFromSuperview();
Flip();
}, UIControlEvent.TouchUpOutside);
_buttonInner.AddTarget(delegate {
_buttonInner.InsertSubviewAbove(buttonListHighlight, _buttonListThumb);
_buttonListThumb.RemoveFromSuperview();
}, UIControlEvent.TouchDown);
// Wire up the series info button
var info = UIButton.FromType(UIButtonType.InfoLight);
info.UserInteractionEnabled = true;
info.AddTarget((s, a)=> { ShowSeriesDetails(); }, UIControlEvent.TouchUpInside);
_infoButton = new UIBarButtonItem(info);
_listButton = new UIBarButtonItem(_buttonInner);
LayoutBarButtonItems();
}