2011-09-09 11 views
-1

相対レイアウトで水平スクロールビューを使用していますが、edittextとボタンの正しい位置合わせが得られていないし、スクロール表示もあまり得られません。何が間違っているのか教えてください私のコードで。私のコードの問題点は教えてください

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/serviceslayout" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:layout_toRightOf="@id/layout1" 
    android:background="#fff"> 

    <HorizontalScrollView android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#333333" android:scrollbarFadeDuration="0"> 

    <RelativeLayout 
     android:id="@+id/serviceslayout2" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:layout_toRightOf="@id/layout1" 
     android:background="#fff"> 

     <TextView android:layout_width="wrap_content" android:id="@+id/txtTieover" android:textColor="#000" android:layout_height="65px" android:text="tie-over" android:layout_below="@+id/txtQuantity2" android:layout_alignParentLeft="true" android:layout_marginLeft="21dp" android:layout_marginTop="13dp"></TextView> 

     <TextView android:layout_width="wrap_content" android:id="@+id/txtQuantity2" android:textColor="#000" android:layout_height="wrap_content" android:text="Quantity" android:layout_alignParentTop="true" android:layout_centerInParent="true"  android:layout_toRightOf="@+id/txtTieover" android:layout_marginLeft="155dp" android:layout_marginTop="20dp" android:layout_gravity="center_horizontal"></TextView> 

     <TextView android:layout_width="wrap_content" android:id="@+id/textView1" android:textColor="#000" android:layout_height="70px" android:text="insert" android:layout_below="@+id/txtTieover" android:layout_alignRight="@+id/txtTieover" android:layout_marginTop="1dp"></TextView> 

     <TextView android:layout_width="wrap_content" android:id="@+id/textView2" android:textColor="#000" android:layout_height="55px" android:text="direct bury" android:layout_below="@+id/textView1" android:layout_toLeftOf="@+id/txtQuantity2" android:layout_marginTop="1dp"></TextView> 

    </RelativeLayout> 
</HorizontalScrollView> 
</RelativeLayout> 
+0

実際の問題(レイアウトの問題など)を反映するために質問を言い換えて、スクリーンショットやレイアウトが現在動作していることの他の指標を投稿してください。 – jefflunt

答えて

1

私は水平スクロールビューでandroid:layout_width="wrap_content" android:layout_height="wrap_content"を使用することは奇妙だと思います。 水平スクロールビューに正確な値または "fill_parent"を指定する方がよいでしょう。

私はあなたのビュー階層とUIプロファイリングについては、この本当にusefeulチュートリアルをお勧めしたい
1

を、idを持つあなたの相対的なレイアウト:serviceslayouttoRightOfを整列させてありますので、イムは期待して別のレイアウトは(宣言されています上のコードでIDがlayout1のレイアウトはありません)。
(定義されている場合)のlayout_widthがfill_parentである場合、上記の相対レイアウトは表示されません。したがって、layout1が画面全体を満たしていないことを確認してください。
これが役に立ちます。

関連する問題