java - Extended SeekBar (Custom View) not showing -


मेरे मुख्य लेआउट xml फ़ाइल में मेरे पास यह है:

  & lt; view class = " Com.mysite.MainActivity $ MySeekBar "android: id =" @ + id / seekBar "एंड्रॉइड: layout_width =" match_parent "एंड्रॉइड: layout_height =" wrap_content "/ & gt;  

और MainActivity.java में मुख्य गतिविधि कक्षा के अंदर मेरे पास यह है:

  सार्वजनिक स्थिर वर्ग MySeekBar SeekBar {public MySeekBar (संदर्भ संदर्भ, AttributeSet attrs, इंट डिफस्टाइल) {सुपर (प्रसंग, एटर्स, डिफस्टाइल); }}  

उपरोक्त मामले में, कुछ नहीं दिखाता है। हालांकि यह काम करता है यदि पहले स्निपेट के बजाय मेरे पास यह है:

  एंड्रॉइड: SeekBar एंड्रॉइड: id = "@ + id / seekBar" एंड्रॉइड: layout_width = "match_parent" एंड्रॉइड: layout_height = " Wrap_content "/ & gt;  

मैंने एक्सएमएल में 'व्यू' के बजाय अपरकेस 'व्यू' का उपयोग करने की कोशिश की है।

मैं क्या कर रहा हूं?

संपादित करें : मैंने निम्नलिखित की कोशिश की है जिसके बाद नीचे एक आंतरिक वर्ग के साथ लागू करने का एक सरल उदाहरण देता है।

डाल दिया इस क्लास में अपनी फाइल

  और lt; com.mypackagename.MySeekBar & lt; == यह एंड्रॉइड अनुपलब्ध है: id = "@ + id / seekBar" एंड्रॉइड: layout_width = "match_parent" एंड्रॉइड: Layout_height = "wrap_content" / & gt;  

Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

Powerbuilder 12.1 and DataWindow in Design vs Debug and Executable/Runtime -

css3 - HTML Block Anchor element only half clickable in Chrome -