我需要知道如何在 ImageView 上放置两个重叠的导航按钮。为了清楚起见,我想要 ImageView 中的上一个和下一个导航按钮。
最佳答案
使用此布局将您的 image
与左上角上方的两个 button
包裹起来。
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView
android:src="@drawable/ic_launcher"
android:layout_alignTop="true"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignBottom="true"/>
<Button
android:id="@+id/buttonLeft"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"/>
<Button
android:id="@+id/buttonRight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toLeftOf="@id/bbuttonLeft"/>
</RelativeLayout>
关于android - 如何在android中的imageview上放置两个导航按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11275082/