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 - Android:联网情况下的随机生成(多人游戏)

Android:使用 setGravity() 对齐按钮中的文本

android - 删除操作栏留下空白

android - 自定义对话框中的 ImageView - fill_parent 不起作用,我的对话框很小

Android指南针噪声算法

android - 捕捉元素/条件布局

java - 如何在 Activity 开始时打开 drawerLayout?

video - 如何为输入颜色设置与视频大小相同的大小?

Android 如何使用叠加在 MapView 中徒手绘制油漆?

jquery - 叠加点击交互问题