android - Set textview width 70% of screen size in linear layout -


मेरे पास इसमें 2 बटन के साथ एक सरल रेखीय लेआउट है।
मैं layout_width = "fill_parent"

लेकिन मैं चाहता हूं कि बटन को स्क्रीन आकार के 70% पर कब्जा करना चाहिए और साथ ही मैं उन्हें केन्द्रित करना चाहता हूं।
मैं इसे कैसे प्राप्त करूं ??

यह अब ऐसा दिखता है।

यहां छवि विवरण दर्ज करें

मुझे ऐसा कुछ चाहिए।

 दर्ज करें </ P> <p> <strong> संपादित करें: </ strong> XML कोड इस प्रकार है: </ p> <pre> <code> & lt; ? Xml संस्करण =

इसे आज़माएं:

  & lt; linearLayout android : Layout_width = "fill_parent" एंड्रॉइड: layout_height = "wrap_content" एंड्रॉइड: अभिविन्यास = "ऊर्ध्वाधर" & gt; & Lt; LinearLayout एंड्रॉइड: layout_width = "fill_parent" एंड्रॉइड: layout_height = "wrap_content" एंड्रॉइड: gravity = "center_horizontal" एंड्रॉइड: ओरिएंटेशन = "क्षैतिज" एंड्रॉइड: weightSum = "1" & gt; & Lt; बटन एंड्रॉइड: layout_width = "0dp" Android: layout_height = "wrap_content" एंड्रॉइड: लेआउट_वेट = "0.7" एंड्रॉइड: टेक्स्ट = "बटन 1" / & gt; & Lt; / LinearLayout & gt; & Lt; LinearLayout एंड्रॉइड: layout_width = "fill_parent" एंड्रॉइड: layout_height = "wrap_content" एंड्रॉइड: gravity = "center_horizontal" एंड्रॉइड: ओरिएंटेशन = "क्षैतिज" एंड्रॉइड: weightSum = "1" & gt; & Lt; बटन एंड्रॉइड: layout_width = "0dp" Android: layout_height = "wrap_content" एंड्रॉइड: लेआउट_वेट = "0.7" एंड्रॉइड: टेक्स्ट = "बटन 1" / & gt; & Lt; / LinearLayout & gt; & Lt; / LinearLayout & gt;    

Comments

Popular posts from this blog

c++ - why does this code produce a runtime error? -

Android - Facebook GraphUser has no email attribute -

Opencart and VQMOD issue: Could not load controller in vq2-system_engine_controller.php -