gpt4 book ai didi

Android:关注 TimePicker 元素

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:31:28 30 4
gpt4 key购买 nike

如何将焦点放在时间选择器元素上?我正在开发电视应用程序,因此需要远程操作。所以我需要关注每个元素。TimePicker 有 3 个元素 - 小时列、分钟列和 AM/PM 列。

那么我如何才能专注于这 3 列中的每一列?

谢谢

最佳答案

你可以获取TimePicker的每一个NumberPicker,然后做任何你想做的修改,请求焦点等等。

NumberPicker hourPicker = (NumberPicker) mTimePicker.findViewById(Resources.getSystem().getIdentifier("hour",
"id", "android"));

NumberPicker minutePicker = (NumberPicker) mTimePicker.findViewById(Resources.getSystem().getIdentifier("minute",
"id", "android"));

NumberPicker amPmPicker = (NumberPicker) mTimePicker.findViewById(Resources.getSystem().getIdentifier("amPm",
"id", "android"));

// this is a number picker modified and there is one for each NumerPicker above
View numberPickerModified = (View) mTimePicker.findViewById(Resources.getSystem().getIdentifier("numberpicker_input",
"id", "android"));

关于Android:关注 TimePicker 元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28858307/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com