2015-03-04 10 views
7

टाइम पिकर तत्वों पर फ़ोकस कैसे करें? मैं टीवी ऐप विकसित कर रहा हूं, इसलिए इसे दूरस्थ द्वारा संचालित किया जाना चाहिए। इसलिए मुझे प्रत्येक तत्व पर ध्यान केंद्रित करने की आवश्यकता है। टाइमपिकर में 3 तत्व हैं - घंटे कॉलम, मिनट कॉलम और एएम/पीएम कॉलम।एंड्रॉइड: टाइमपिकर तत्वों पर फ़ोकस

तो मैं इन 3 कॉलम में से प्रत्येक पर ध्यान कैसे प्राप्त करूं?

धन्यवाद

उत्तर

7

आप 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")); 
+0

हाय, क्या आप कृपया समझा सकते हैं कि मैं टाइमरपीकर पर एडफोकसबल्स का उपयोग कैसे कर सकता हूं? – Gaurav

+0

यह बेहतर है कि आपने मुझसे अलग किया है। कृपया फिर से देखें कि मैंने –

+0

संपादित किया है यह मेरे लिए पूरी तरह से काम करता है। धन्यवाद – Gaurav

संबंधित मुद्दे