android - Different Listview divider after last item but before footer -


मैं my_list.xml सूचीदृश्य से डिफ़ॉल्ट विभक्त को निकाल कर अपने कस्टम विभक्त को सेट कर रहा हूं:

<पूर्व> & lt; LinearLayout xmlns: एंड्रॉइड = "http://schemas.android.com/apk/res/android" एंड्रॉइड: orientation = "ऊर्ध्वाधर" एंड्रॉइड: layout_width = "match_parent" एंड्रॉइड: layout_height = " Match_parent "android: background =" @color / app_background "& gt; एंड्रॉयड: divider = "@ null" एंड्रॉइड: dividerHeight = "0dp" / & gt; & Lt; / LinearLayout & gt;

और प्रत्येक आइटम में my_item.xml के तहत देखें जोड़ना ( relativeLayout आइटम आइकन; रैखिक लेआउट आइटम टेक्स्ट धारण करता है):

  & lt;? Xml संस्करण = "1.0" एन्कोडिंग = "यूटीएफ -8"? & Gt; & Lt; LinearLayout xmlns: android = "http://schemas.android.com/apk/res/android" एंड्रॉइड: ओरिएंटेशन = "क्षैतिज" एंड्रॉइड: layout_width = "match_parent" एंड्रॉइड: layout_height = "60dp" एंड्रॉइड: पृष्ठभूमि = " @ रंग / सफेद "& gt; & Lt; RelativeLayout एंड्रॉइड: layout_width = "60dp" एंड्रॉइड: layout_height = "match_parent" & gt; & Lt; ImageView एंड्रॉइड: आईडी = "@ + आईडी / आइकन" एंड्रॉइड: लेआउट_विड्थ = "60 डीपी" एंड्रॉइड: layout_height = "60dp" एंड्रॉइड: src = "@ ड्रॉएबल / स्टैटिकमैप" & gt; & Lt; / imageView & gt; & Lt; / RelativeLayout & gt; & Lt; LinearLayout xmlns: एंड्रॉइड = "http://schemas.android.com/apk/res/android" android: orientation = "ऊर्ध्वाधर" एंड्रॉइड: layout_width = "match_parent" एंड्रॉइड: layout_height = "match_parent" एंड्रॉइड: पृष्ठभूमि = " @ रंग / सफेद "& gt; ... & lt; एंड्रॉइड देखें: layout_width = "match_parent" एंड्रॉइड: layout_height = "1dp" एंड्रॉइड: पृष्ठभूमि = "# E4E4E4" / & gt; & Lt; / LinearLayout & gt; & Lt; / LinearLayout & gt;  

मुझे प्रत्येक आइटम पाठ के तहत कस्टर्स डिवाइडर (देखें) के लिए धन्यवाद, लेकिन आइटम आइकन के तहत नहीं।

सूची के आखिरी आइटम के बाद मैं चाहता हूं कि डिवाइडर भी इस तरह आइकन के तहत दिखाई दें:

ये लेआउट्स फ़लना हैं:

  @Override सार्वजनिक शून्य पर क्रिएट (बंडल सहेजे गए इन्स्टेंसस्टेट) {Super.onCreate (सहेजे गए इन्स्टेंसस्टेट); SetListAdapter (नया अर्रे एडाप्टर & lt; DummyContent.DummyItem & gt; (getActivity (), R.layout.my_item, R.id.label, DummyContent.ITEMS)); } @ ओवरराइड सार्वजनिक देखें क्रेट दृश्य (लेआउट इनफ्लेटटर इन्फ्लाटर, व्यू ग्रुप कंटेनर, बंडल सहेजे गए इन्स्टेंसस्टेट) {return inflater.inflate (R.layout.my_list, null); } @ ओवरराइड पब्लिक रिक्त ऑन एक्टिविटी क्रेटेड (बंडल सहेजे गए इन्स्टेंसस्टेट) {getListView ()। AddFooterView (getLayoutInflater (सहेजे गए इन्स्टैंसस्टेट)। इन्फलेट (आर। लेट। मैडिटेशन, रिक्त)); super.onActivityCreated (savedInstanceState); }  

बस आइकन के नीचे एक ही विभक्त दृश्य को भी जोड़ें।

  & lt; एंड्रॉइड देखें: layout_width = "match_parent" एंड्रॉइड: layout_height = "1dp" एंड्रॉइड: दृश्यता = "चला गया" एंड्रॉइड: पृष्ठभूमि = "# E4E4E4" / & gt;  

और इसे getView () में दिखाई दे रहा है कि यह ListView

< P> या

बस उस पूरी चौड़ाई विभक्त दृश्य को पाद लेख में जोड़ें और मौजूदा मदर के दृश्य को पिछले आइटम में छुपाएं, वही getView ()


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

asp.net mvc - How to attach sql database to a javascript graph -

c# - How to know the number of Threads created and limit the Tasks accordingly -