2011-02-09 93 views
0

我有一個自定義對話框,顯示下面的一些文本和圖像。Android - 自定義對話框佈局問題

該文本由幾行代碼組成,儘管數百萬次的XML佈局都是亂七八糟的,但底部的圖像總是與一半或一些文本重疊。我如何調整它,使其顯示在文本完成後下方?

<ImageView android:id="@+id/image" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
     android:layout_centerHorizontal="true" 
      /> 

<ScrollView android:id="@+id/ScrollView01" 
     android:layout_width="wrap_content" 
       android:layout_below="@+id/image" 
     android:layout_height="200px">   

    <TextView android:id="@+id/text" 
      android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:textColor="#FFF" 
      /> 

</ScrollView>  

<ImageView android:id="@+id/image2" 
      android:layout_height="wrap_content" 
      android:layout_width="wrap_content" 
      android:layout_centerHorizontal="true" 
      android1:layout_alignParentBottom="true"/> 

項目在RelativeLayout設置中設置。

+0

如果您添加了xml佈局,則更容易幫助您。 – 2011-02-09 11:59:56

+0

向我們展示這裏的xml佈局。 – Javanator 2011-02-09 12:02:15

回答

0

如果將TextView和ImageView包裝在RelativeLayout中,則可以將ImageView設置爲在TextView下方顯示。

<ImageView android:id="@+id/image2" 
    android:layout_height="wrap_content" 
    android:layout_width="wrap_content" 
    android:layout_centerHorizontal="true" 
    android:layout_alignParentBottom="true" 
    android:layout_below="@+id/ScrollView01"/> 

編輯: 我看到你已經設置android1:layout_alignParentBottom = 「真」,是它與android1一個錯字,而不是的android?不應該是android:layout_alignParentBottom =「true」?