图像视图上的Android透明工具栏
我在试着有一个 这样它将显示在图像视图上的Android透明工具栏,android,android-layout,Android,Android Layout,我在试着有一个 这样它将显示在ImageView的顶部,设置如下: <ImageView android:layout_width="fill_parent" android:layout_height="0px" android:layout_weight="8" android:scaleType="center" android:id="@+id/imageView" android:layout_alignParentTop="tr
ImageView
的顶部,设置如下:
<ImageView
android:layout_width="fill_parent"
android:layout_height="0px"
android:layout_weight="8"
android:scaleType="center"
android:id="@+id/imageView"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:elevation="0dp"
/>
图(蓝色区域是一个图像视图
):
因此,它是透明的,但它将ImageView
向下推,而不是放在上面
我也试过使用,但没用。工具栏只是视图组。因此,考虑制作布局,如相对布局。 在相对布局中,u有这样的顺序:布局代码中的较低位置,则此视图将被视为布局的最高层。所以,把你的观点按正确的顺序排列,你就会得到想要的结果。以前为我工作过很多次 使用框架布局
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
// Your imageview
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
//your toolbar
</FrameLayout>
//您的图像视图
//你的工具栏
这应该会有所帮助