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
复制代码

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

查看所有标签

猜你喜欢:

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

Build Your Own Web Site the Right Way Using HTML & CSS

Build Your Own Web Site the Right Way Using HTML & CSS

Ian Lloyd / SitePoint / 2006-05-02 / USD 29.95

Build Your Own Website The Right Way Using HTML & CSS teaches web development from scratch, without assuming any previous knowledge of HTML, CSS or web development techniques. This book introduces you......一起来看看 《Build Your Own Web Site the Right Way Using HTML & CSS》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

html转js在线工具
html转js在线工具

html转js在线工具