android - 如何在图库上叠加 ImageView ?

标签 android android-layout overlay

我想像下图那样叠加 imageview 和 gallery

i want like this

我试过这样的..

<RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="70dp" >
<ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"        
        android:src="@drawable/title_header" />

<Gallery 
        android:id="@+id/Gallery" 
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content"></Gallery>

</RelativeLayout>

但它不是叠加层。请帮助我..

最佳答案

请试试这个

<RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="70dp" >

<Gallery 
    android:id="@+id/Gallery" 
    android:layout_width="fill_parent" 
    android:layout_marginTop="10dip"
    android:layout_height="wrap_content"></Gallery>

<ImageView
    android:layout_width="wrap_content"
    android:layout_alignParentTop="true"
    android:layout_height="wrap_content"        
    android:src="@drawable/title_header" />

</RelativeLayout>

android:layout_marginTop="10dip" 根据需要赋值。

关于android - 如何在图库上叠加 ImageView ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14810527/

相关文章:

java - 如何遍历Firebase实时数据库中的多个子项?

Android:如何获取列表项包含的所有数据?

android - 如何从在 XML 中创建的 SupportMapFragment 获取 GoogleMap 对象? API 级别 8

android - 如何在 Android 上的应用程序启动器图标上显示气球计数器

CSS:Opacity - Div 在 IE7 中不显示?

android - 与 HandlerThread 通信的示例

android - 在底部导航 View 中删除操作栏

android - 如何在 Android 中显示顶部栏消息

Android:在屏幕上定位文字。 Google ML Kit 边界框有点偏离

ffmpeg:用于过滤器比较的滑动覆盖