Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/234.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
图像视图上的Android透明工具栏_Android_Android Layout - Fatal编程技术网

图像视图上的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>

//您的图像视图
//你的工具栏
这应该会有所帮助