नमस्कार कोई मेरी मदद कर सकता है कि इस चित्र की तरह xml desgin कैसे प्राप्त करें:
सब कुछ आसान है, लेकिन मैं सिर्फ फोन के दाएं कोने के लिए कीमत निर्धारित करना चाहता हूं, लेकिन मुझे नहीं पता कि कैसे:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/white"
android:id="@+id/souscarte_element_layout">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:id="@+id/souscarte_element_title"
android:text="deddewdedwe"/>
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:id="@+id/souscarte_element_prix"
android:gravity="right"
android:text="12E"/>
</LinearLayout>
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/souscarte_element_desc"
android:text="deddewdedwe"/>
</LinearLayout>
धन्यवाद
उत्तर:
जवाब के लिए 0 № 1जैसा कि आपने कोशिश की है मैं डिजाइन को पूरा करने के लिए आपकी सहायता कर रहा हूं। ऐसा करने के बहुत सारे तरीके हैं लेकिन मैं डिजाइन को पूरा करने के लिए आपके कोड को थोड़ा संशोधित कर रहा हूं
शीर्ष 2 में TextView
अपने कोड जोड़ें android:layout_weight
टैग। जैसे ही आप उपयुक्त पाते हैं मूल्य निर्धारित करें। उदाहरण के लिए पहले का वजन निर्धारित करें TextView
3 और दूसरा 1. फिर कुछ अतिरिक्त पैडिंग में Textview
इसे सुंदर बनाने के लिए।