android - 如何在android中的imageview上放置两个导航按钮

标签 android android-layout

我需要知道如何在 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/

相关文章:

android - 将文本与微调器的中心对齐

android - Android中的iOS StackView相当于什么

android - 字符串太长的 TextView

android - 在Android Canvas 透明矩形上绘制双色正方形

Android - 通过 USB 从健康设备读取数据

android - 在Studio下的错误目录中创建文件

android - Android中如何根据时间调暗屏幕

Android Circle Shape in 16 to 23 Android版本

java - hdpi 和 xhdpi 手机的不同尺寸

java - Android应用登录注册报错