美文网首页
Android开发问题汇总

Android开发问题汇总

作者: 德罗德 | 来源:发表于2017-04-26 10:46 被阅读9次
    1.如何进入页面不focus任何view?
    设置父布局
        android:focusable="true" 
        android:focusableInTouchMode="true"
    
    2.为何添加了测试库,但扔import不到?
    testCompile
    androidTestCompile
    在
    buildTypes {
        debuggable true
    }
    才生效
    
    3.canvas.drawText垂直居中
    参数y为baseline
    baseline = height - FontMetrics.bottom - FontMetrics.top
    
    4. over bounds of view
        setClipChildren
        setClipToPadding
    
    5.lineSpacing的版本兼容
    TextView lineSpacing  api<21 包含一行间距, api>=21不包含,需要通过value,value-21做兼容
    
    6.指定abi编译

    build.gradle

    ndk {
            abiFilters = []
            abiFilters.addAll(ABI_FILTERS.split(';').collect{it as String})
    }
    

    gradle.properties

    ABI_FILTERS=armeabi
    
    7.VIVO adb install

    gradle.properties

    android.injected.testOnly = false
    
    8.使用EventBus Subscriber Index 时 未执行并生成索引文件
    @SupportedAnnotationTypes("org.greenrobot.eventbus.Subscribe")
    @SupportedOptions(value = {"eventBusIndex", "verbose"})
    public class EventBusAnnotationProcessor extends AbstractProcessor {
    ……
    }
    

    只有包含getSupportedAnnotationTypes类型的项目才会执行AnnotationProcessor,当前library并没有使用@org.greenrobot.eventbus.Subscribe注解

    相关文章

      网友评论

          本文标题:Android开发问题汇总

          本文链接:https://www.haomeiwen.com/subject/obkizttx.html