本文整理汇总了C#中Xamarin.Forms.Picker.Focus方法的典型用法代码示例。如果您正苦于以下问题:C# Picker.Focus方法的具体用法?C# Picker.Focus怎么用?C# Picker.Focus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Xamarin.Forms.Picker
的用法示例。
在下文中一共展示了Picker.Focus方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateEventPage
//.........这里部分代码省略.........
TimePicker endTimePicker = new TimePicker();
endTimePicker.WidthRequest = 0;
endTimePicker.HeightRequest = 0;
endTimePicker.IsVisible = false;
endTimePicker.PropertyChanged += (object sender, System.ComponentModel.PropertyChangedEventArgs e) =>
{
try
{
if ("Time" == e.PropertyName)
{
string amPM = (endTimePicker.Time.Hours > 12) ? "PM" : "AM";
endTimePickerButton.Text = endTimePicker.Time.ToString();// endTimePicker.Time.Hours.ToString () + " : " + endTimePicker.Time.Minutes.ToString() + " " + amPM;
}
}
catch (Exception ex)
{
var test = ex.Message;
}
};
//startDatePickerButton = new CustomImageButton();
startDatePickerButton.ImageName = Device.OnPlatform("select_box_whitebg.png", "select_box_whitebg.png", "//Assets//select_box_whitebg.png");
startDatePickerButton.Text = "Start Date";
startDatePickerButton.FontSize = 17;
startDatePickerButton.FontFamily = Constants.HELVERTICA_NEUE_LT_STD;
startDatePickerButton.TextOrientation = interfaces.TextOrientation.Left;
startDatePickerButton.TextColor = Color.Gray;
startDatePickerButton.WidthRequest = deviceSpec.ScreenWidth * 40 / 100;
startDatePickerButton.Clicked += (object sender, EventArgs e) =>
{
try
{
startDatePicker.Date = DateTime.Now.AddDays(1);
startDatePicker.Focus();
}
catch (Exception ex)
{
var test = ex.Message;
}
};
// startTimePickerButton = new CustomImageButton();
startTimePickerButton.ImageName = Device.OnPlatform("select_box_whitebg.png", "select_box_whitebg.png", "//Assets//select_box_whitebg.png");
startTimePickerButton.Text = " Start Time";
startTimePickerButton.TextOrientation = TextOrientation.Middle;
startTimePickerButton.FontSize = 17;
startTimePickerButton.FontFamily = Constants.HELVERTICA_NEUE_LT_STD;
startTimePickerButton.TextOrientation = interfaces.TextOrientation.Left;
startTimePickerButton.TextColor = Color.Gray;
startTimePickerButton.WidthRequest = deviceSpec.ScreenWidth * 40 / 100;
startTimePickerButton.Clicked += (object sender, EventArgs e) =>
{
try
{
startTimePicker.Time = new TimeSpan(12, 00, 00);
startTimePicker.Focus();
}
catch (Exception ex)
{
var test = ex.Message;
}
};