私はRelativeLayout
with one ImageButton
、 one ToggleButton
、およびその他のコントロールを持っています。RelativeLayout の右側に配置された両方のボタン。同じ高さにしてほしい。ここに私のレイアウトxmlがあります:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="5dip"
android:paddingRight="5dip"
android:paddingBottom="10dip" >
<ImageButton
android:id="@+id/imageButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/copy"
android:layout_alignParentRight="true" />
<ToggleButton
android:id="@+id/buttonView"
android:layout_width="wrap_content"
android:layout_height="0dip"
android:textOn="Hide"
android:textOff="View"
android:layout_toLeftOf="@id/imageButton"
android:layout_alignTop="@id/imageButton"
android:layout_alignBottom="@id/imageButton" />
<!-- ... other controls ... -->
</RelativeLayout>
ToggleButton を ImageButton と同じ高さに設定layout_height="0dip"
して使用しようとしましlayout_alignTop
たが、これは機能しません。layout_alignBottom
ご覧のとおり、ToggleButton は正しく配置されておらず、常に ImageButton よりわずかに高くなっています。私は何を間違っていますか?
Android 2.3 でのテスト