logo
  • 教程列表
  • SO官方文档
  • 数据绑定库
    • 基本文本字段绑定
    • 内置双向数据绑定
    • 使用 lambda 表达式的自定义事件
    • 数据绑定中的默认值
    • 使用访问器方法绑定
    • 对话框中的数据绑定
    • 引用类
    • 片段中的数据绑定
    • RecyclerView 适配器中的数据绑定
    • 单击具有 Binding 的侦听器
    • 带自定义变量的 DataBinding(intboolean)
    • 将小部件作为 BindingAdapter 中的引用传递
  1. StackOverflow 文档
  2. Android 教程
  3. 数据绑定库
  4. 对话框中的数据绑定

对话框中的数据绑定

Created: November-22, 2018

public void doSomething() {
    DialogTestBinding binding = DataBindingUtil
            .inflate(LayoutInflater.from(context), R.layout.dialog_test, null, false);

    Dialog dialog = new Dialog(context);
    dialog.setContentView(binding.getRoot());
    dialog.show();
}
  • 引用类
  • 使用访问器方法绑定

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 关于我们
  • 免责声明