简体   繁体   English

我如何触及framelayout中的版式

[英]how can i touch behind layout in framelayout

I'm new in android.I want to make layout same like Etsy application.In my xml layout i have imageview behind the content layout.When the user scroll the content layout will be overlay on the imageview.I was put other layout with same size with imageview but i can't touch imageview .How can i touch the behind layout(ImageView) in this situation. 我是android的新手,我想要使布局与Etsy应用程序相同。在我的xml布局中,我在内容布局后面有imageview。当用户滚动时,内容布局将覆盖在imageview上。与imageview的大小,但我不能触摸imageview。在这种情况下,如何触摸后面的布局(ImageView)。

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >

<ImageView
    android:id="@+id/test"
    android:layout_width="fill_parent"
    android:layout_height="200dp"
    android:background="@drawable/sl"
    android:gravity="center" />

<ScrollView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" >

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical" >

        <LinearLayout
            android:id="@+id/demo"
            android:layout_width="fill_parent"
            android:layout_height="200dp"
            android:orientation="horizontal" >
        </LinearLayout>

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="#345343"
            android:orientation="vertical" >

            <TextView
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:background="#123456"
                android:gravity="center"
                android:padding="50dp"
                android:text="@string/hello_world"
                android:textColor="#FFFFFF" />

            <TextView
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:padding="50dp"
                android:text="@string/hello_world" />

            <TextView
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:padding="50dp"
                android:text="@string/hello_world" />

            <TextView
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:padding="50dp"
                android:text="@string/hello_world" />

            <TextView
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:padding="50dp"
                android:text="@string/hello_world" />

            <TextView
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:padding="50dp"
                android:text="@string/hello_world" />

            <TextView
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:padding="50dp"
                android:text="@string/hello_world" />

            <TextView
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:padding="50dp"
                android:text="@string/hello_world" />

            <TextView
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:padding="50dp"
                android:text="@string/hello_world" />
        </LinearLayout>
    </LinearLayout>
</ScrollView>

The ideal same like this : 理想的是这样的:

https://www.dropbox.com/s/3d1o4a93qwm4bjn/Screen%20Shot%202014-03-09%20at%2018.50.22.png https://www.dropbox.com/s/rc9p8tgdsh17hyq/Screen%20Shot%202014-03-09%20at%2018.50.15.png https://www.dropbox.com/s/3d1o4a93qwm4bjn/Screen%20Shot%202014-03-09%20at%2018.50.22.png https://www.dropbox.com/s/rc9p8tgdsh17hyq/Screen%20Shot%202014 -03-09%20at%2018.50.15.png

Set Layout "clickable" attribute value as "false" 将“可点击的布局”属性值设置为“ false”

android:clickable="false"

I hope it will works for you. 希望它对您有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM