Data Binding 系列(二)环境准备

栏目: IOS · Android · 发布时间: 6年前

内容简介:推荐使用最新版本的 Gradle 插件,要求 1.5.0 或以上版本。使用

Data Binding 是一个支持库,支持 Android 4.0(API level 14)以上的所有设备。

推荐使用最新版本的 Gradle 插件,要求 1.5.0 或以上版本。

编译环境

使用 Data Binding 需要在 module 级别的 build.gradle 文件中添加如下所示的代码:

android {
    ...
    dataBinding {
        enabled = true
    }
}
复制代码

注:如果 app module 依赖的库使用了 Data Binding ,即使 app module 没有直接使用 Data Binding ,它也需要在 build.gradle 中配置 Data Binding

新版 Data Binding 编译器

新版编译器可以提高构建速度,使用新版编译器需要在 gradle.properties 文件中添加如下代码:

android.databinding.enableV2=true
复制代码

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Understanding Machine Learning

Understanding Machine Learning

Shai Shalev-Shwartz、Shai Ben-David / Cambridge University Press / 2014 / USD 48.51

Machine learning is one of the fastest growing areas of computer science, with far-reaching applications. The aim of this textbook is to introduce machine learning, and the algorithmic paradigms it of......一起来看看 《Understanding Machine Learning》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

随机密码生成器
随机密码生成器

多种字符组合密码

SHA 加密
SHA 加密

SHA 加密工具