2012-02-13 4 views
0

私はListViewを持っています。その1列は、Button,CheckBox、マルチラインTextViewを含んでいます。 XMLレイアウト:ListViewAndroid - ボタンの高さをチェックボックスの高さで調整しますか?

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent" 
       android:layout_centerVertical="true"> 

    <Button android:id="@+id/open" 
       android:layout_height="wrap_content" 
       android:layout_width="wrap_content" 
       android:src="@drawable/play" 
       android:text="Play" 
       android:layout_centerVertical="true" 
      /> 

    <CheckBox android:id="@+id/check" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_centerVertical="true" 
      android:layout_toRightOf="@id/open" 
      /> 

    <TextView android:text="@+id/label" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:id="@+id/label" 
      android:textSize="16px" 
      android:layout_toRightOf="@id/check" 
      android:paddingLeft="4px" 
      /> 

</RelativeLayout> 

スクリーンショット:私は、チェックボックスの高さとボタンの高さを調整することができますどのように

Screenshot of Listview

+0

を解決しましたか? – waqaslam

+0

ダウンロード開始ボタンとリストビューは、通常、ある種のLinearLayout AFIKにありますので、おそらくあなたのLinearLayoutに何か問題があります。 –

答えて

1

相対レイアウトのALIGN_TOPおよびALIGN_BOTTOMプロパティを確認してください。ボタンの上部と下部をチェックボックスの上部と下部に揃えることができます。

0

ボタンにカスタムスタイルを設定し、デフォルト値より低いパディング値を設定することができます。
ボタンの余白を設定できます。
ボタンの高さに固定のDP値を設定できます。スタートのためのあなたのXMLがボタンをダウンロードいただきまし

0

<Button android:id="@+id/open" 
     ...  
     style="?android:attr/buttonStyleSmall" 
     ... 
     />