| | |
| | | /// <param name="i_hour">默认选择时</param>
|
| | | /// <param name="i_minute">默认选择分</param>
|
| | | /// <param name="contentView">选择区域高度</param>
|
| | | public void InitControl(int i_hour, int i_minute,int contentView = 297)
|
| | | public void InitControl(int i_hour, int i_minute,int contentView = 297,bool isHour = true)
|
| | | {
|
| | | //已经初始化
|
| | | if (base.btnCancel != null) { return; }
|
| | |
| | | base.btnConfirm.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | //有选择了才能点确认
|
| | | if (selectHour != 0 || selectMinute != 0)
|
| | | //if (selectHour != 0 || selectMinute != 0)
|
| | | {
|
| | | base.Close();
|
| | | this.FinishEvent?.Invoke(1, selectHour, selectMinute);
|
| | |
| | | var strhour = Language.StringByID(StringId.h);
|
| | | //分
|
| | | var strMinute = Language.StringByID(StringId.m);
|
| | |
|
| | | if(!isHour) |
| | | { |
| | | strhour = Language.StringByID(StringId.m); |
| | | strMinute = Language.StringByID(StringId.s);
|
| | | }
|
| | |
|
| | | //XX时
|
| | | listHour = new List<string>();// { "00" + strhour };
|
| | | //XX分
|
| | |
| | | value2 = 0; |
| | | pickerView.setCurrentItems(value1, value2, 0); |
| | | } |
| | | else |
| | | //else |
| | | { |
| | | //更改索引 |
| | | selectHour = Convert.ToInt32(listHour[value1].Substring(0, 2)); |
| | | selectMinute = Convert.ToInt32(listMinute[value2].Substring(0, 2)); |
| | | }
|
| | | }; |
| | | }
|
| | | } |
| | |
|
| | | #endregion
|
| | |
|