本文整理汇总了C#中UIPickerView.SelectedRowInComponent方法的典型用法代码示例。如果您正苦于以下问题:C# UIPickerView.SelectedRowInComponent方法的具体用法?C# UIPickerView.SelectedRowInComponent怎么用?C# UIPickerView.SelectedRowInComponent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UIPickerView
的用法示例。
在下文中一共展示了UIPickerView.SelectedRowInComponent方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Selected
public override void Selected(UIPickerView picker, nint row, nint component)
{
if(component == 0 && row > picker.SelectedRowInComponent(1))
{
picker.Select(row, 1, true);
}
if(component == 1 && row < picker.SelectedRowInComponent(0))
{
picker.Select(row, 0, true);
}
}
示例2: PickerAlert
public PickerAlert(string[] values, int currentSelected, Action<int> selected)
: base(new RectangleF(0, 0, 320f, 480f))
{
AutosizesSubviews = true;
this.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
_values = values;
_currentSelected = currentSelected;
_selected = selected;
_pickerView = new UIPickerView();
_pickerView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth;
_pickerView.ShowSelectionIndicator = true;
_pickerView.Model = new PickerModel(values);
_pickerView.BackgroundColor = UIColor.FromRGB(244, 244, 244);
_pickerView.Select(currentSelected, 0, false);
_toolbar = new UIToolbar();
_toolbar.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleTopMargin;
_toolbar.Items = new UIBarButtonItem[]
{
new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace),
new UIBarButtonItem("Done", UIBarButtonItemStyle.Done, (s, e) => {
_selected(_pickerView.SelectedRowInComponent(0));
Dismiss();
})
};
_innerView = new UIView(new RectangleF(0, Frame.Height, Frame.Width, 44f + _pickerView.Frame.Height));
_innerView.AutosizesSubviews = true;
_innerView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleTopMargin;
_toolbar.Frame = new RectangleF(0, 0, Frame.Width, 44f);
_innerView.Add(_toolbar);
_pickerView.Frame = new RectangleF(0, 44f, Frame.Width, _pickerView.Frame.Height);
_innerView.Add(_pickerView);
Add(_innerView);
}
示例3: Selected
public override void Selected (UIPickerView picker, int row, int component)
{
tvc.currentSystemItem = (UIBarButtonSystemItem) picker.SelectedRowInComponent (0);
tvc.CreateToolbarItems ();
}
示例4: getRowerId
public string getRowerId(UIPickerView picker)
{
return rowerIds [picker.SelectedRowInComponent (0)];
}
示例5: Selected
public override void Selected(UIPickerView pickerView, nint row, nint component)
{
Quiz.SelectedAnswer = Convert.ToByte(pickerView.SelectedRowInComponent(0));
}
示例6: Selected
public override void Selected (UIPickerView picker, int row, int component)
{
var qbv = (QuartzBlendingView) parent.quartzView;
qbv.DestinationColor = Colors [picker.SelectedRowInComponent (0)];
qbv.SourceColor = Colors [picker.SelectedRowInComponent (1)];
qbv.BlendMode = (CGBlendMode) picker.SelectedRowInComponent (2);
qbv.SetNeedsDisplay ();
}
示例7: actionChangeKey
partial void actionChangeKey(NSObject sender)
{
_actionSheet = new UIActionSheet("Title", null, string.Empty, string.Empty, null);
var pickerView = new UIPickerView(new RectangleF(0, 44, 320, 300));
pickerView.ShowSelectionIndicator = true;
pickerView.WeakDelegate = this;
var toolbar = new UIToolbar(new RectangleF(0, 0, 320, 44));
toolbar.BarStyle = UIBarStyle.Black;
UIBarButtonItem flexSpace = new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace);
var button = new UIButton(UIButtonType.Custom);
button.SetTitle("Done", UIControlState.Normal);
button.Layer.CornerRadius = 8;
button.Layer.BackgroundColor = GlobalTheme.SecondaryColor.CGColor;
button.Font = UIFont.FromName("HelveticaNeue-Bold", 12.0f);
button.Frame = new RectangleF(0, 20, 60, 30);
button.TouchUpInside += (sender2, e) => {
int key = _keys[pickerView.SelectedRowInComponent(0)].Item1;
OnChangeKey(key);
_actionSheet.DismissWithClickedButtonIndex(0, true);
};
var btnDone = new UIBarButtonItem(button);
toolbar.SetItems(new UIBarButtonItem[2] { flexSpace, btnDone }, true);
_actionSheet.AddSubview(toolbar);
_actionSheet.AddSubview(pickerView);
_actionSheet.ShowInView(UIApplication.SharedApplication.KeyWindow);
_actionSheet.Bounds = new RectangleF(0, 0, 320, 344);
int index = _keys.IndexOf(_currentKey);
pickerView.Select(index, 0, false);
}
示例8: 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;
//.........这里部分代码省略.........
示例9: Selected
public override void Selected(UIPickerView picker, nint row, nint component)
{
nint selected = picker.SelectedRowInComponent(0);
var chart = tk.chart;
switch (selected)
{
case 0:
chart.Palette = Xuni.iOS.ChartCore.XuniPalettes.Standard;
break;
case 1:
chart.Palette = Xuni.iOS.ChartCore.XuniPalettes.Cocoa;
break;
case 2:
chart.Palette = Xuni.iOS.ChartCore.XuniPalettes.Coral;
break;
case 3:
chart.Palette = Xuni.iOS.ChartCore.XuniPalettes.Dark;
break;
case 4:
chart.Palette = Xuni.iOS.ChartCore.XuniPalettes.Highcontrast;
break;
case 5:
chart.Palette = Xuni.iOS.ChartCore.XuniPalettes.Light;
break;
case 6:
chart.Palette = Xuni.iOS.ChartCore.XuniPalettes.Midnight;
break;
case 7:
chart.Palette = Xuni.iOS.ChartCore.XuniPalettes.Minimal;
break;
case 8:
chart.Palette = Xuni.iOS.ChartCore.XuniPalettes.Modern;
break;
case 9:
chart.Palette = Xuni.iOS.ChartCore.XuniPalettes.Organic;
break;
case 10:
chart.Palette = Xuni.iOS.ChartCore.XuniPalettes.Slate;
break;
case 11:
chart.Palette = Xuni.iOS.ChartCore.XuniPalettes.Zen;
break;
case 12:
chart.Palette = Xuni.iOS.ChartCore.XuniPalettes.Cyborg;
break;
case 13:
chart.Palette = Xuni.iOS.ChartCore.XuniPalettes.Superhero;
break;
case 14:
chart.Palette = Xuni.iOS.ChartCore.XuniPalettes.Flatly;
break;
case 15:
chart.Palette = Xuni.iOS.ChartCore.XuniPalettes.Darkly;
break;
case 16:
chart.Palette = Xuni.iOS.ChartCore.XuniPalettes.Cerulean;
break;
default:
break;
}
}
示例10: Selected
public override void Selected(UIPickerView picker, int row, int component)
{
pvc.label.Text = String.Format ("{0} - {1}",
names [picker.SelectedRowInComponent (0)],
picker.SelectedRowInComponent (1));
}
示例11: loadAffiliatePickerView
// Use For Actionsheet picker view
public void loadAffiliatePickerView ()
{
List<String> segmentosStrings = new List<String> ();
if (Constant.affiliateResponse != null) {
for (int i = 0; i < Constant.affiliateResponse.data.Count; i++) {
segmentosStrings.Add (Constant.affiliateResponse.data [i].name.ToString());
}
}
picker_model_Segmentos = new PickerModel (segmentosStrings);
picker_Segmentos = new UIPickerView ();
picker_Segmentos.Model = picker_model_Segmentos;
picker_Segmentos.ShowSelectionIndicator = true;
UIToolbar toolbar = new UIToolbar ();
toolbar.BarStyle = UIBarStyle.Black;
toolbar.Translucent = true;
toolbar.SizeToFit ();
var tapRecognizer = new UITapGestureRecognizer ();
tapRecognizer.AddTarget(() => {
Console.WriteLine("CLICK");
});
tapRecognizer.NumberOfTapsRequired = 2;
tapRecognizer.NumberOfTouchesRequired = 1;
picker_Segmentos.AddGestureRecognizer(tapRecognizer);
UIBarButtonItem doneButton = new UIBarButtonItem ("Done", UIBarButtonItemStyle.Bordered,(s, e) => {
// Console.WriteLine((int)picker_Segmentos.SelectedRowInComponent);
Console.WriteLine(picker_model_Segmentos.values[(int)picker_Segmentos.SelectedRowInComponent(0)].ToString ());
affiliateName.SetTitle(picker_model_Segmentos.values[(int)picker_Segmentos.SelectedRowInComponent(0)].ToString (), UIControlState.Normal);
affName.ResignFirstResponder ();
for (int i = 0; i < Constant.affiliateResponse.data.Count; i++) {
if(Constant.affiliateResponse.data [i].name.ToString() == picker_model_Segmentos.values[(int)picker_Segmentos.SelectedRowInComponent(0)].ToString ()){
Constant.selectedAffialte.data = Constant.affiliateResponse.data[i];
}
}
});
UIBarButtonItem cancelButton = new UIBarButtonItem ("cancel", UIBarButtonItemStyle.Bordered, (s, e) => {
affName.ResignFirstResponder ();
});
toolbar.SetItems (new UIBarButtonItem[]{ doneButton, cancelButton }, true);
toolbar.TintColor = UIColor.White;
affName.InputView = picker_Segmentos;
this.View.BackgroundColor = UIColor.Black;
affName.InputAccessoryView = toolbar;
affName.AddGestureRecognizer (tapRecognizer);
}
示例12: GetBoatId
public string GetBoatId(UIPickerView picker)
{
return boatIds [picker.SelectedRowInComponent(0)];
}
示例13: pickerViewModel
public void pickerViewModel(UITextField textFieldItem, List<string> segmentosStrings, UIButton button)
{
PickerModel picker_model_Segmentos = new PickerModel (segmentosStrings);
UIPickerView picker_Segmentos = new UIPickerView ();
picker_Segmentos.Model = picker_model_Segmentos;
picker_Segmentos.ShowSelectionIndicator = true;
UIToolbar toolbar = new UIToolbar ();
toolbar.BarStyle = UIBarStyle.Black;
toolbar.Translucent = true;
toolbar.SizeToFit ();
var tapRecognizer = new UITapGestureRecognizer ();
tapRecognizer.AddTarget(() => {
Console.WriteLine("CLICK");
});
tapRecognizer.NumberOfTapsRequired = 2;
tapRecognizer.NumberOfTouchesRequired = 1;
picker_Segmentos.AddGestureRecognizer(tapRecognizer);
UIBarButtonItem doneButton = new UIBarButtonItem ("Done", UIBarButtonItemStyle.Bordered,(s, e) => {
// Console.WriteLine((int)picker_Segmentos.SelectedRowInComponent);
Console.WriteLine(picker_model_Segmentos.values[(int)picker_Segmentos.SelectedRowInComponent(0)].ToString ());
textFieldItem.Text = picker_model_Segmentos.values[(int)picker_Segmentos.SelectedRowInComponent(0)].ToString ();
if(button.Tag == 2 || button.Tag == 3){
Console.WriteLine("longCode ButtonClicked");
}
textFieldItem.ResignFirstResponder ();
});
UIBarButtonItem cancelButton = new UIBarButtonItem ("cancel", UIBarButtonItemStyle.Bordered, (s, e) => {
textFieldItem.ResignFirstResponder ();
});
toolbar.SetItems (new UIBarButtonItem[]{ doneButton, cancelButton }, true);
toolbar.TintColor = UIColor.White;
textFieldItem.InputView = picker_Segmentos;
this.View.BackgroundColor = UIColor.Clear;
textFieldItem.InputAccessoryView = toolbar;
textFieldItem.AddGestureRecognizer (tapRecognizer);
}
示例14: Selected
public override void Selected(UIPickerView picker, nint row, nint component)
{
var selObjctes = new List<object>();
var aMsg = String.Empty;
foreach(var aId in mDataDict.Keys)
{
var selIndex = picker.SelectedRowInComponent(aId);
var aList = mDataDict[aId];
var aRow = aList.Items[(int)selIndex];
selObjctes.Add(aRow.SelectedValue);
aMsg += aRow.DisplayValue + mTableViewCell.SeperatorCharacter;
}
if (aMsg.EndsWith(mTableViewCell.SeperatorCharacter))
aMsg = aMsg.Substring(0,aMsg.LastIndexOf(mTableViewCell.SeperatorCharacter));
mTableViewCell.RightLabel.Text = aMsg;
SelectedItems = selObjctes.ToArray();
mTableViewCell.DidSelectItem(selObjctes.ToArray());
}
示例15: CreateSubmitButton
private UIButton CreateSubmitButton(UIPickerView hoursField, UITextField commentField, UISwitch sickLeaveField)
{
var submitButton = new UIButton(UIButtonType.System)
{
Frame = new CGRect(20, 320, View.Bounds.Width - 40, 32),
};
submitButton.SetTitle("Submit", UIControlState.Normal);
submitButton.TouchUpInside += async (sender, e) =>
{
var timesheetEntryHoursViewModel = (TimesheetEntryHoursViewModel)hoursField.Model;
var selectedHours = timesheetEntryHoursViewModel.SelectedValue(hoursField, hoursField.SelectedRowInComponent(0), 0);
TimesheetEntry.Hours = Convert.ToDecimal(selectedHours);
TimesheetEntry.Comment = commentField.Text;
TimesheetEntry.SickLeave = sickLeaveField.On;
ShowLoadingOverlay();
try
{
await TimesheetService.SubmitTimesheetEntry(TimesheetEntry);
NavigationController.PopViewController(true);
}
catch (Exception ex)
{
var okAlertController = UIAlertController.Create("Error", ex.Message, UIAlertControllerStyle.Alert);
okAlertController.AddAction(UIAlertAction.Create("OK", UIAlertActionStyle.Default, null));
PresentViewController(okAlertController, true, null);
}
LoadingOverlay.Hide();
};
return submitButton;
}