2011-10-15 21 views
0

我對xml編碼非常陌生。我通常使用android的圖形佈局工具來設計我的視圖。但是現在我遇到了設計自定義XML視圖的問題。下面是我想要的設計圖片。請建議我如何設計。不同盒子之間的空間也需要考慮。如果您可以爲此提供一些xml代碼,那對我來說會非常有幫助。爲我的android活動設計一個定製的xml視圖

enter image description here

+0

要水平滾動視圖或簡單 –

回答

2
<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 
    <ScrollView android:layout_height="wrap_content" android:id="@+id/scrollView1" android:layout_width="match_parent"> 
     <LinearLayout android:id="@+id/linearLayout1" android:layout_width="match_parent" android:layout_height="match_parent"> 
      <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="My Text View" android:id="@+id/textView1" android:textAppearance="?android:attr/textAppearanceLarge"></TextView> 


     </LinearLayout> 
    </ScrollView> 
    <LinearLayout android:layout_height="wrap_content" android:id="@+id/linearLayout2" android:layout_width="match_parent" android:orientation="horizontal"> 
    <LinearLayout android:layout_height="wrap_content" android:id="@+id/linearLayout3" android:layout_weight="1" android:layout_width="fill_parent" android:orientation="vertical"> 
     <ImageButton android:layout_height="wrap_content" android:id="@+id/imageButton1" android:src="@drawable/icon" android:layout_width="fill_parent"></ImageButton> 
     <ImageView android:id="@+id/imageView1" android:layout_height="wrap_content" android:src="@drawable/icon" android:layout_width="fill_parent"></ImageView> 
    </LinearLayout> 
    <EditText android:layout_width="fill_parent" android:layout_weight="1" android:text="abcdef" android:layout_height="wrap_content" android:id="@+id/editText1" android:inputType="textMultiLine"> 
     <requestFocus></requestFocus> 
    </EditText> 
    </LinearLayout> 

</LinearLayout> 

調整參數,根據您的需要

相關問題