मैं तीन तत्वों के साथ एक लेआउट है और उसके उन्मुखीकरण 'क्षैतिज'एंड्रॉयड काम नहीं कर रहा weightSum ठीक से
है मैं आकार कि प्रत्येक तत्व मेरी लेआउट में कब्जा करना चाहते हैं।
पहले तत्व को कुल स्थान का 40% लेना चाहिए तो दूसरा तत्व 5% पर कब्जा कर लेना चाहिए और तीसरा व्यक्ति शेष 55% स्थान पर कब्जा कर लेना चाहिए।
इस तरह मेरे लेआउट देखो: 'TextView' में
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="100" >
<TextView
android:id="@+id/outletname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="40"
android:text="@string/outlet_name2" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="5"
android:text=": " />
<TextView
android:id="@+id/outletnamevalue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="55"
android:text="abcdefttt" />
</LinearLayout>
</LinearLayout>
टेक्स्ट डायनामिक बदल जाएगा, तो मैं विचारों में सामग्री पर ध्यान दिए बिना तत्वों के लिए निरंतर अंतरिक्ष रखना चाहते हैं ...
जवाब पूरा करने के लिए, एक समझना चाहिए कि वजन केवल/शेष/अंतरिक्ष, यानि कि अंतरिक्ष एक बार layout_width मूल्य लागू किया गया था छोड़ दिया करने के लिए लागू होता है। – njzk2
इसने मेरा दिन बनाया: डी कितने सालों के लिए ... एलओएल। तो यह समस्या पर एकमात्र जवाब है। UPVOTEEEEEEE – jace