xml - Android - Border around ListFragment? -


मेरे पास गतिविधि है जिसमें गतिविधि के एक्सएमएल में एक ListFragment शामिल है फ़ाइल ...

  & lt; fragment android: id = "@ + id / shoppingListNamesFragment" एंड्रॉइड: name = "com.example.ShoppingListNamesFragment" एंड्रॉइड: layout_below = "@ id / shoppingListsTitle" एंड्रॉइड : Layout_width = "match_parent" एंड्रॉइड: layout_height = "wrap_content" / & gt;  

मैं इस टुकड़े के चारों ओर सीमा रखना चाहता हूं। मैंने इसे ऊपर एक्सएमएल में जोड़ने की कोशिश की है ...

  android: background = "@ drawable / white_dashed_border" एंड्रॉइड: padding = "14dp" एंड्रॉइड: layout_margin = "14dp"  

... लेकिन यह सीमा नहीं पैदा करता है (जबकि यह एक सीमा बना देता है अगर मैं उन 3 लाइनों को एक्सएमएल में जोड़ता हूं, उदाहरण के लिए, एक LinearLayout पर)।

मैं सूचीफ़्रेग्मेंट (आदर्श रूप से xml का उपयोग करके) की सीमा को कैसे जोड़ूं?

पीएस - कोई ऐसा प्रश्न है जो एक मूल लेआउट को जोड़ने का सुझाव देता है, लेकिन मैं इसे संभवत: से बचाना चाहता हूं।

बॉर्डर को अपने ListFragment के लेआउट xml के मूल तत्व में जोड़ें:

  & lt; Android: layout_width = "match_parent" एंड्रॉइड: layout_height = "wrap_content" एंड्रॉइड: पृष्ठभूमि = "@ ड्रॉएबल / व्हाइट_डिस्क_बॉर्डर" एंड्रॉइड: padding = "14dp" एंड्रॉइड: लेआउट_मार्गिन = "14dp" & gt;  

Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -