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

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

查看所有标签

猜你喜欢:

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

The Intersectional Internet

The Intersectional Internet

Safiya Umoja Noble、Brendesha M. Tynes / Peter Lang Publishing / 2016

From race, sex, class, and culture, the multidisciplinary field of Internet studies needs theoretical and methodological approaches that allow us to question the organization of social relations that ......一起来看看 《The Intersectional Internet》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

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

在线XML、JSON转换工具