小编Ngh*_*Dao的帖子

如何防止ScrollView拦截其背后的点击/触摸事件?

我在FrameLayout中有一个ScrollView和一个ImageView.ImageView位于滚动视图的后面

我的ScrollView有一个透明空间(LinearLayout s_layout_transparent,高度为925px).

所以我的ImageView 可以通过这个透明空间看到,但无法点击.

我试图添加一些值(android:clickable ="false"android:focusable ="android:focusableInTouchMode ="false")滚动视图以防止它拦截ImageView的点击事件,但这根本不起作用.

这是我的布局:

<FrameLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent">
<LinearLayout
        android:gravity="top|center_horizontal"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:paddingRight="10dp"
        >
    <ImageView
            android:visibility="visible"
            android:id="@+id/s_imgv_splash"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/temp_detail_screen_splash"
            android:adjustViewBounds="true"
            android:scaleType="fitXY"/>
</LinearLayout>
<com.dreambox.android.saven.Views.ScrollView
        android:id="@+id/s_scrollview_event_detail"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:scrollbars="none"
        android:visibility="visible"
        android:clickable="false"
        android:focusable="false"
        android:focusableInTouchMode="false"
        >
    <LinearLayout
            android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:clickable="false"
            android:focusableInTouchMode="false"
            android:focusable="false">
        <LinearLayout
                android:id="@+id/s_layout_transparent"
                android:layout_gravity="center_vertical"
                android:layout_width="match_parent"
                android:layout_height="925px"
                android:orientation="horizontal"
                android:background="@color/trasparent"
                android:clickable="false"
                android:focusableInTouchMode="false"
                android:focusable="false">
        </LinearLayout>
        <LinearLayout...>
        <LinearLayout...>
    </LinearLayout>
</com.dreambox.android.saven.Views.ScrollView>
</FrameLayout>
Run Code Online (Sandbox Code Playgroud)

android touch-event android-layout

8
推荐指数
3
解决办法
8274
查看次数

Android:构建APK文件时出现duplicati条目错误

当我为我的项目为android studio(版本2.0)构建一个APK文件时,出现错误:

错误:任务':app:transformClassesWithJarMergingForDebug'的执行失败.> com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复项:组织/阿帕奇/ oltu /的oauth2 /普通/ OAuth的$ ContentType.class

这是我的gradle文件:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
    }

    defaultConfig {
        applicationId "com.db.android.app.denhathai"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 14
        versionName "1.2.2"
        multiDexEnabled true

        manifestPlaceholders = [manifestApplicationId          : "${applicationId}",
                                onesignal_app_id               : "bad49395-e355-4802-8df1-414be2d345ac",
                                onesignal_google_project_number: "1071797880741"]
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }
    }

    dependencies {
    compile fileTree(include: …
Run Code Online (Sandbox Code Playgroud)

android android-multidex

4
推荐指数
1
解决办法
1068
查看次数