मेरे पास Android के लिए अगला खराब डिज़ाइन है:
मुझे More infos
को काले पाठ के दाईं ओर आइकन के साथ रखना होगा। अगर Item 1 of 1
लंबी स्ट्रिंग होगी, तो यह आइकन+टेक्स्ट को दाईं ओर धकेल देगी। मेरी समस्या जिसका मैं पता नहीं लगा सकता, यदि बायाँ पाठ एक पंक्ति में फ़िट होने के लिए बहुत लंबा है, तो मैं चाहता हूँ कि More infos
को उसके माता-पिता के दाहिने किनारे तक धकेला जाए और वहीं और बाईं ओर रहे काला पाठ एक नई पंक्ति में कूदना चाहिए।
लेकिन इस तरह से कार्य करने के लिए यह HTML नहीं है! :) मैं इसे कैसे पूरा कर सकता हूँ पर कोई विचार?
मैं वास्तव में डिजाइनर से डिजाइन बदलने के लिए कहने की सोच रहा हूं।
संपादित करें
मैंने इसके लिए ऊपर जैसा दिखने के लिए क्या किया है:
<RelativeLayout ...>
<!--TEXT-->
<TextView
android:id="@+id/list_item_form_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/app_spacing_x0_5"
android:layout_marginTop="@dimen/app_spacing_x3"
android:textColor="@color/app_black"
android:textSize="@dimen/app_text_tiny" />
<!--VIEW DETAILS-->
<TextView
android:id="@+id/list_item_view_details_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="50dp"
android:layout_toRightOf="@id/list_item_form_text"
android:layout_alignTop="@id/list_item_form_text"
android:drawableLeft="@drawable/ic_camera"
android:drawablePadding="@dimen/app_spacing_x0_3"
android:text="@string/f_form_front_view_details" />
</RelativeLayout>
2 जवाब
आप इसे LinearLayout
के साथ प्राप्त कर सकते हैं:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="test"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="123444"/>
</LinearLayout>
कुंजी में wrap_content
के साथ रैखिक लेआउट और weight=1
और width=0dp
के साथ पहला दृश्य है।
शायद कुछ ऐसा:
<!--TEXT-->
<TextView
android:id="@+id/list_item_form_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:text="Long long long long text Long long long long text"
android:layout_toStartOf="@+id/list_item_view_details_btn"
android:layout_alignParentStart="true"/>
<!--VIEW DETAILS-->
<TextView
android:id="@+id/list_item_view_details_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="50dp"
android:layout_alignParentEnd="true"
android:layout_alignTop="@id/list_item_form_text"
android:text="More infos"/>
परिणाम है:
संबंधित सवाल
नए सवाल
android
एंड्रॉइड Google का मोबाइल ऑपरेटिंग सिस्टम है, जिसका उपयोग प्रोग्रामिंग या डिजिटल डिवाइस (स्मार्टफोन, टैबलेट, ऑटोमोबाइल्स, टीवी, वियर, ग्लास, IoT) को विकसित करने के लिए किया जाता है। एंड्रॉइड से संबंधित विषयों के लिए, एंड्रॉइड-विशिष्ट टैग जैसे कि एंड्रॉइड-इरादे, एंड्रॉइड-गतिविधि, एंड्रॉइड-एडॉप्टर आदि का उपयोग करें। विकास या प्रोग्रामिंग के अलावा अन्य प्रश्नों के लिए, लेकिन एंड्रॉइड फ्रेमवर्क से संबंधित हैं, इस लिंक का उपयोग करें: https: // android.stackexchange.com।