我的应用程序的RecycleViews没有滚动条,但它适用于新项目

时间:2017-09-27 07:25:21

标签: android

我发现此代码在我的项目中无效。

android:scrollbars="vertical"

但如果我将其设置为新的 DEMO ,则可行。 我认为它是关于应用程序样式或build.gradle中的某些内容,但我尝试了很多方法而且它没有用(比如将应用程序样式从我的项目复制到新项目中)并应用它,它仍然有效),任何其他人有这个问题? 这是我的build.gradle代码:

 android {
compileSdkVersion COMPILE_SDK_VERSION as int
buildToolsVersion BUILD_TOOLS_VERSION

defaultConfig {
    applicationId "com.haixue.app.android.HaixueAcademy.h4"
    minSdkVersion MIN_SDK_VERSION as int
    targetSdkVersion TARGET_SDK_VERSION as int
    versionCode 3210
    versionName "3.2.1beta"
    multiDexEnabled true 
    resConfigs "zh"

    resValue("string", "growingio_project_id", "8701f2e2e096a888")
    resValue("string", "growingio_url_scheme",       "growing.42190e827fb47099")

    ndk {
        abiFilters "armeabi", "armeabi-v7a"
    }
    useLibrary 'org.apache.http.legacy'
}

aaptOptions {
    additionalParameters "--no-version-vectors"
}

packagingOptions {
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/MANIFEST.MF'
    exclude 'META-INF/maven/com.squareup.okio/okio/pom.properties'
    exclude 'META-INF/maven/com.squareup.okio/okio/pom.xml'
}

lintOptions {
    abortOnError false
    xmlReport false
    htmlReport true
    htmlOutput file("$project.buildDir/reports/lint/lint-result.html")
    xmlOutput file("$project.buildDir/reports/lint/lint-result.xml")
}
signingConfigs {
    release {
        storeFile file("../docs/haixue.keystore")
        storePassword "123456"
        keyAlias "highso"
        keyPassword "123456"
    }
    debug {
        storeFile file("../docs/haixue.keystore")
        storePassword "123456"
        keyAlias "highso"
        keyPassword "123456"
    }
}


walle {
    apkOutputFolder = new File("${project.buildDir}/outputs/channels");

    apkFileNameFormat = '${appName}-${channel}-${buildType}-v${versionName}.apk';

    channelFile = new File("${project.getProjectDir()}/channel")
}

buildTypes {
    debug {
        debuggable true
        minifyEnabled false
        shrinkResources false
        testCoverageEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }

    release {
        minifyEnabled true
        shrinkResources true
        zipAlignEnabled true
        signingConfig signingConfigs.release
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}


applicationVariants.all { variant ->
    variant.outputs.each { output ->
        def outputFile = output.outputFile
        if (outputFile != null && outputFile.name.endsWith('.apk')) {
            def fileName = outputFile.name.replace(".apk", "-${defaultConfig.versionName}.apk")
            output.outputFile = new File(outputFile.parent, fileName)
        }
    }
}

//JNI
sourceSets {
    main {
        jni.srcDirs = []
        jniLibs.srcDir(['libs'])
    }
}

dexOptions {
    javaMaxHeapSize "4g"
}

repositories {
    flatDir {
        dirs 'libs'
    }
}
}

 dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(':RtmpResourceLib')
compile project(':imagepicker')
compile project(':viewPagerlibrary')
compile project(':SlidingMenu')
compile project(':treeviewlist')
compile project(':NodeView')
compile files('libs/jcore-android-1.1.6.jar')
compile files('libs/jpush-android-3.0.8.jar')
compile files('libs/TalkFunSDK.jar')
compile files('libs/alipaySingle-20170510.jar')
compile(name: 'alicloud-android-feedback-3.1.1', ext: 'aar')
compile files('libs/alicloud-android-utils-1.0.3.jar')
compile files('libs/utdid4all-1.1.5.3_proguard.jar')
compile files('libs/alicloud-android-monitor-2.5.1.1_for_bc_proguard.jar')
//noinspection GradleCompatible
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:appcompat-v7:26.0.2'
compile 'com.android.support:recyclerview-v7:26.0.2'
compile 'com.android.support:design:26.0.2'
compile 'com.android.support:support-annotations:26.0.2'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.code.gson:gson:2.8.1'
//compile 'com.tencent.bugly:crashreport:2.6.5' crashreport_upgrade
compile 'com.tencent.bugly:crashreport_upgrade:latest.release'
compile 'com.tencent.bugly:nativecrashreport:latest.release'
compile 'com.growingio.android:vds-android-agent:1.0.3@aar'
compile 'com.umeng.analytics:analytics:latest.integration'
compile 'com.tencent.mm.opensdk:wechat-sdk-android-with-mta:1.0.2'
compile 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
compile 'com.github.Aspsine:SwipeToLoadLayout:1.0.4'
compile 'com.github.PhilJay:MPAndroidChart:v3.0.0'
compile 'com.lzy.net:okgo:2.1.4'
compile 'com.github.hackware1993:MagicIndicator:1.5.0'
compile 'org.greenrobot:eventbus:3.0.0'
compile 'com.zhy:autolayout:1.4.5'
compile 'io.reactivex.rxjava2:rxjava:2.1.3'
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
compile 'com.j256.ormlite:ormlite-android:5.0'
compile 'com.j256.ormlite:ormlite-core:5.0'
compile 'com.meituan.android.walle:library:1.1.3'
compile 'com.zhy:flowlayout-lib:1.0.3'
compile 'com.scwang.smartrefresh:SmartRefreshLayout:1.0.3'
compile 'com.google.android.exoplayer:exoplayer-core:r2.5.2'
compile 'com.google.android.exoplayer:exoplayer-hls:r2.5.2'
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.3'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.3'
compile 'com.kyleduo.switchbutton:library:1.4.6'
}

1 个答案:

答案 0 :(得分:0)

我明白了        @android:彩色/透明 SomeOthers在我们的应用程序样式中设置了此代码,此代码使ScrollBar透明。