2012-03-31 6 views
2

私はいくつかのボタンといくつかのTextViewで構成されるアンドロイドでレイアウトを実装しようとしています。私はTextView(私が実装しているゲームのログです)のうち1つが利用可能なすべてのスペースを占有し、表示するテキストが多すぎる場合はスクロール可能にします。しかし、私はそれが膨張すると、その下の無オーバーレイビューにそれを得るように見えることはできません - その代わり、それは画面の下に停止します。このスクリーンショットで他のビューをカバーしないでTextViewを展開する

enter image description here

を、「スコアボード」のTextViewがあります「手」TextView、「ログ」TextView、およびいくつかのボタンを備えたLinearLayoutがあります。すべてTextViewには動的な長さがありますが、最初の2つは数行以上を占めていません。トラブルは、ログが展開され、その下のボタンをカバーしていることです(プラス側でスクロール可能です)。これを修正する方法を教えてもらえますか?

は、ここでレイアウトXMLです:

<?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="wrap_content" > 

    <TextView 
     android:id="@+id/scoreboard" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentTop="true" 
     android:text="Scoreboard" /> 

    <TextView 
     android:id="@+id/handinfo" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_below="@+id/scoreboard" 
     android:text="Hand" /> 

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

     <Button 
      android:id="@+id/stay" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:enabled="false" 
      android:text="Stay" /> 

     <Button 
      android:id="@+id/leave" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:enabled="false" 
      android:text="Leave" /> 

     <Button 
      android:id="@+id/pay" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:enabled="false" 
      android:text="Pay" /> 

     <Button 
      android:id="@+id/payWithWild" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:enabled="false" 
      android:text="Pay Wild" /> 

     <Button 
      android:id="@+id/dontPay" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:enabled="false" 
      android:text="Don&apos;t Pay" /> 
    </LinearLayout> 

    <ScrollView 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_below="@+id/handinfo" > 

     <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:id="@+id/log" 
      android:text="" /> 

    </ScrollView> 



</RelativeLayout> 

答えて

4

は、あなたのScrollViewに次の属性を追加し、それが表示を修正する必要があります。

android:layout_below="@id/handinfo" 
android:layout_above="@id/linearLayout1" 
+0

のでシンプル。それは動作します、ありがとう! –

関連する問題