迁移到AndroidX后的Lint错误:

问题描述 投票:2回答:1

迁移/重构到AndroidX后(使用Android Studio 3.2 RC2中的迁移工具),我得到了一大堆以下类型的Lint错误:

participant_menu.xml:9: Error: Should use android:showAsAction when not using the appcompat library [AppCompatResource]
          app:showAsAction="never" />

我糊涂了;我猜这是Lint中与迁移到AndroidX相关的错误。我是正确的,还是应该切换回android命名空间?

注意:我的minSDK设置为API 16。

android-studio lint androidx
1个回答
0
投票

不使用appcompat库[AppCompatResource] app时应该使用android:showAsAction:showAsAction =“never”

如果你没有使用Appcompat库,我相信你应该使用:

android:showAsAction="never"

(Qazxswpoi)

此外,似乎Androidx中仍然存在一些需要文档或直接指导的问题,因为我看到有些人遇到此问题或使用As documentation says等问题。

© www.soinside.com 2019 - 2024. All rights reserved.