本文整理汇总了C#中UIPickerView.RemoveFromSuperview方法的典型用法代码示例。如果您正苦于以下问题:C# UIPickerView.RemoveFromSuperview方法的具体用法?C# UIPickerView.RemoveFromSuperview怎么用?C# UIPickerView.RemoveFromSuperview使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UIPickerView
的用法示例。
在下文中一共展示了UIPickerView.RemoveFromSuperview方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ViewDidLoad
public override void ViewDidLoad()
{
base.ViewDidLoad ();
Console.WriteLine ("PBS VDL");
this.NavigationController.NavigationBar.TintColor = UIColor.FromRGB (237, 152, 0);
this.NavigationController.NavigationBar.BarTintColor = UIColor.FromRGB (52, 19, 0);
float sH = UIScreen.MainScreen.Bounds.Height;
float sW = UIScreen.MainScreen.Bounds.Width;
var volumeView = new MPVolumeView(new RectangleF(50,sH - 100,200,50));
volumeView.ShowsVolumeSlider = true;
volumeView.ShowsRouteButton = true;
volumeView.TintColor = UIColor.FromRGB (237, 152, 0);
View.AddSubview (volumeView);
var volumeUpView = new UIImageView (new RectangleF (260, sH - 104, 26, 26));
volumeUpView.Image = UIImage.FromFile("volume_up-26.png");
View.AddSubview (volumeUpView);
var volumeDownView = new UIImageView (new RectangleF (20, sH - 104, 26, 26));
volumeDownView.Image = UIImage.FromFile ("volume_down-26.png");
View.AddSubview (volumeDownView);
var pickerView = new UIPickerView (new RectangleF (0, sH - 207, sW, 162)); // heigth must be 162, 180, 216
pickerView.BackgroundColor = UIColor.FromRGB (52, 19, 0);
pickerView.TintColor = UIColor.FromRGB (237, 152, 0);
// not adding to the view yet because this is a multipurpose picker and the addition is done per the purpose with the btn delegate
positionSld.SetThumbImage (UIImage.FromFile ("position.png"), UIControlState.Normal);
positionSld.MinValue = 0f;
// disable all the buttons I don't want enabled when not playing
playPauseBtn.Enabled = false;
positionSkipBtn.Enabled = false;
stopBtn.Enabled = false;
timerBtn.Enabled = false;
pickerSetBtn.Hidden = true;
pickerSetBtn.Enabled = false;
pickerCnlBtn.Hidden = true;
pickerCnlBtn.Enabled = false;
pickerLbl.Hidden = true;
if (resumeCheck == 1) {
Console.WriteLine ("F: VDL RPA: " + resumePassAuthor);
ResumeBook (resumePassTitle, resumePassAuthor);
}
_musicPlayer = new MPMusicPlayerController ();
_mediaController = new MPMediaPickerController (MPMediaType.Music);
_mediaController.AllowsPickingMultipleItems = false;
_mpDelegate = new MediaPickerDelegate (this);
_mediaController.Delegate = _mpDelegate;
infoScreen = new InfoScreen ();
addMusicBtn.TouchUpInside += delegate {
this.PresentViewController(_mediaController, true, null);
};
infoBtn.TouchUpInside += delegate {
this.PresentViewController(infoScreen, true, null);
};
positionSkipBtn.Clicked += delegate {
pickerView.Model = new ThePickerViewModel(0);
View.AddSubview(pickerView);
pickerLbl.Text = "Skip To";
pickerLbl.Hidden = false;
pickerSetBtn.Enabled = true;
pickerSetBtn.Hidden = false;
pickerCnlBtn.Enabled = true;
pickerCnlBtn.Hidden = false;
};
timerBtn.Clicked += (object sender, EventArgs e) => {
pickerView.Model = new ThePickerViewModel(1);
View.AddSubview(pickerView);
pickerLbl.Text = "Sleep Timer";
pickerLbl.Hidden = false;
pickerSetBtn.Enabled = true;
pickerSetBtn.Hidden = false;
pickerCnlBtn.Enabled = true;
pickerCnlBtn.Hidden = false;
};
pickerSetBtn.TouchUpInside += delegate {
if (pickerLbl.Text == "Skip To"){
int hourValue = pickerView.SelectedRowInComponent(0);
int minValue = pickerView.SelectedRowInComponent(1);
int secValue = pickerView.SelectedRowInComponent(2);
double pickedTimeValue = ((hourValue * 3600) + (minValue * 60) + secValue);
int pickedTimeInt = Convert.ToInt32(pickedTimeValue);
_musicPlayer.CurrentPlaybackTime = pickedTimeValue;
string pickerTimeDisplay = string.Format("{0:#0}:{1:00}:{2:00}",pickedTimeInt/3600,(pickedTimeInt/60)%60,pickedTimeInt%60);
currentTimeLbl.Text = pickerTimeDisplay;
positionSld.SetValue( (float)(pickedTimeValue), true);
pickerView.RemoveFromSuperview();
pickerLbl.Hidden = true;
pickerSetBtn.Hidden = true;
//.........这里部分代码省略.........
示例2: ViewDidLoad
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
// Perform any additional setup after loading the view, typically from a nib.
this.NavigationController.NavigationBarHidden = true;
//UIPickerView--------------------------------------------------------------
//model for data loading
PickerModel model = new PickerModel(this.View);
//picker
UIPickerView picker = new UIPickerView();
picker.Frame = new RectangleF(0,164,768,216);
picker.ShowSelectionIndicator = true;
picker.Model = model;
//--------------------------------------------------------------------------
//Setup the toolbar
UIToolbar toolbar = new UIToolbar();
toolbar.Frame = new RectangleF(0,380,768,44);
toolbar.BarStyle = UIBarStyle.Black;
toolbar.Translucent = true;
toolbar.SizeToFit();
//Create a 'done' button for the toolbar and add it to the toolbar
UIBarButtonItem doneButton =
new UIBarButtonItem
("Done",UIBarButtonItemStyle.Done,
(s,e) =>
{
//do something after the values is selected
// this.txtCurrentAltitude.ResignFirstResponder();
picker.RemoveFromSuperview();
toolbar.RemoveFromSuperview();
}
);
UIBarButtonItem loadButton =
new UIBarButtonItem
("Load",UIBarButtonItemStyle.Bordered,
(s,e) =>
{
//do something after the values is selected
}
);
toolbar.SetItems(new UIBarButtonItem[]{doneButton,loadButton},true);
btnLoadPicker.TouchUpInside += (object sender, EventArgs e) =>
{
this.View.AddSubview(picker);
this.View.AddSubview(toolbar);
};
//UIPickerView--------------------------------------------------------------
//DialogView----------------------------------------------------------------
FPLView.BackgroundColor = new UIColor(0.89f,0.78f,0.56f,1.00f);
ListBoxDialog lbd = new ListBoxDialog();
MTDView.AddSubview(lbd.View);
btnFPLLoad.BackgroundColor = new UIColor(0.78f,0.65f,0.39f,1.00f);
//COLOR ON PRESS
// btnFPLLoad.TintColor = new UIColor(0.78f,0.65f,0.39f,1.00f);
btnFPLCancel.BackgroundColor = new UIColor(0.78f,0.65f,0.39f,1.00f);
btnFPLCancel.TouchUpInside += (object sender, EventArgs e) =>
{
FPLView.RemoveFromSuperview();
};
btnDialog.TouchUpInside += (object sender, EventArgs e) =>
{
this.View.AddSubview(FPLView);
};
}