2013-03-15 63 views
-6

您好有人能幫助我如何獲得一個XML DESGIN喜歡這幅畫:enter image description hereAndroid的 - 簡單的設計

一切都是容易的,但我只想把價格定到手機的右上角,但我不知道如何:

<?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

您是指不同文本區域的佈局,還是您在尋找應用邊框的幫助? – Rawkode 2013-03-15 16:03:40

+0

你必須至少付出努力。我們不會爲您編寫代碼。包括你已經嘗試過的一些XML ... – 2013-03-15 16:06:32

回答

0

正如你已經試過我協助你完成設計。有很多方法可以做到這一點,但我只是稍微修改一下代碼來完成設計

在您的代碼的前2個TextView中添加android:layout_weight標記。根據您的需要設置值。例如設置第一個TextView 3和第二個的重量。然後在Textview中添加一些額外的填充以使其美觀。

+0

謝謝你就是我想要的..大聲笑壞trololo,在Android設計是很挑剔.. – eento 2013-03-19 14:30:46