2012-03-25 10 views
2

http://dl.dropbox.com/u/24856/android_issue.PNGalignparentbottomに実行中のコンテンツ

私は上部にテキストビューを表示し、下部に2つのネストされたボタンを持つ相対レイアウトを実行しています。私は、上の要素にマージンボトムを置き、マージントップとandroid:layout_alignParentBottom要素を入れてみましたが、テキストがボタンに当たったという事実は変わりませんでした。あなたはので、ここでレイアウトファイルを提供しなかった

答えて

2

は、その問題を回避する方法に小さな例です。

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" > 

    <LinearLayout 
     android:id="@+id/btn_bar" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_alignParentBottom="true" > 

     <Button 
      android:id="@+id/button1" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Button1" /> 

     <Button 
      android:id="@+id/button2" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Button2" /> 
    </LinearLayout> 

    <ScrollView 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_above="@id/btn_bar" 
     android:layout_alignParentTop="true" > 

     <TextView 
      android:id="@+id/textView1" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:text="TextView" /> 
    </ScrollView> 


</RelativeLayout> 
+0

私は1つの親scrollviewを持っていたので、代わりに私は親がrelativelayoutを表示し、中にscrollviewを入れて作られました私のメインコンテンツで、スクロールビューの下にはボタン付きのもう一つの相対的なビューがありました - ありがとう! – tipu

関連する問題