0
  • 最佳答案

    view 的 id 不再是常量了 黄油刀都不推荐开发者使用了,让你用 ViewBinding 或者 DataBinding


    官网介绍:

    Attention: This tool is now deprecated. Please switch to view binding. Existing versions will continue to work, obviously, but only critical bug fixes for integration with AGP will be considered. Feature development and general bug fixes have stopped.


    注意:此工具现已弃用。请切换到 视图绑定。显然,现有版本将继续工作,但只会考虑与 AGP 集成的关键错误修复。功能开发和一般错误修复已停止。


    1204736502274318336  评论     打赏       A lonely cat
    • 阿肥  回复 @A lonely cat
      旧版本 不能继续使用吗 databinding还是和kt一块用好 那无解了么
      阿肥 2022-03-16 10:56   回复 1382711465131241472
    • A lonely cat  回复 @阿肥
      ViewBinding 就很好用啊
      A lonely cat 2022-03-16 11:08   回复 1204736502274318336
    • 阿肥  回复 @A lonely cat
      不能继承base 好难受 估计得从设计开始就决定选啥了
      阿肥 2022-03-16 11:19   回复 1382711465131241472
    • A lonely cat  回复 @阿肥
      前两天隔壁群还在说 Base 里最好不要涉及到 UI 的封装
      A lonely cat 2022-03-16 11:26   回复 1204736502274318336
    • 阿肥  回复 @A lonely cat
      好廖 刚刚viewbinding有个错误来着 一个属性加上去 就总是build不到类
      阿肥 2022-03-16 12:08   回复 1382711465131241472
    • A lonely cat  回复 @阿肥
      你姿势不对
      A lonely cat 2022-03-16 12:32   回复 1204736502274318336
    • 阿肥  回复 @A lonely cat
      进去了 可以用了
      阿肥 2022-03-16 14:05   回复 1382711465131241472
    • A lonely cat  回复 @阿肥
      欧克 有用记得结贴
      A lonely cat 2022-03-16 14:08   回复 1204736502274318336
    • 阿肥  回复 @A lonely cat
      真香 不用fvb 了 舒服
      阿肥 2022-03-16 14:57   回复 1382711465131241472
    • A lonely cat  回复 @阿肥
      嗯呐 一旦用上就不想再写 fbi 了
      A lonely cat 2022-03-16 14:59   回复 1204736502274318336
  • fdv

    1231137268748521472  评论     打赏       码划云
    • 阿肥  回复 @码划云
      太懒了 就用viewdatabing了
      阿肥 2022-03-16 14:00   回复 1382711465131241472
    • A lonely cat 2022-03-16 14:07   回复 1204736502274318336
  • // 黄油刀
    implementation 'com.jakewharton:butterknife:8.8.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
    

    版本如上

    1382711465131241472  评论     打赏       阿肥
    相关问题
    幻影~ · 安卓
    2024-04-26 19:25 10 4
    deanhu · AOSP
    2024-04-25 21:53 3 10
    幻影~ · 提问
    2024-04-13 20:13 10 2
    幻影~ · 找工作
    2024-04-07 10:44 18 2
    幻影~ · 问题
    2024-03-31 17:20 7 2
    TONYGFX · AOSP
    2024-03-28 17:11 4 2