gpt4 book ai didi

android - 调试android数据绑定(bind)?

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:31:00 26 4
gpt4 key购买 nike

谁能告诉我如何调试或找到数据绑定(bind)生成的代码。来自 this链接 我发现它生成了所需的代码。

最佳答案

我猜您正在寻找自动生成的绑定(bind) java 文件。

我也在找他们。最后我在这条路上找到了他们:

/app/build/intermediates/classes/debug/{你的包}/databinding/ActivityMainBinding.java

即/app/build/intermediates/classes/debug/com/example/databindingdtest/databinding/ActivityMainBinding.java

请注意,这个自动生成的 java 文件是根据 Google's guide 以您的布局名称命名的。 :

Custom Binding Class Names

By default, a Binding class is generated based on the name of the layout file, starting it with upper-case, removing underscores ( _ ) andcapitalizing the following letter and then suffixing “Binding”. This classwill be placed in a databinding package under the module package. For example, the layout file contact_item.xml will generate ContactItemBinding. If the module package is com.example.my.app, then it will be placed in com.example.my.app.databinding.

希望这对你有帮助:-)

关于android - 调试android数据绑定(bind)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34176948/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com