所以我知道 GridView 已被弃用,但可以将 GridView 用于生产代码吗?
我想将它用于我的游戏应用程序。
Android Studio 客户端表示它已被弃用,取而代之的是 ConstraintLayout,但尝试设置网格(这应该是一个非常简单、直接的任务)使用 ConstraintLayout 非常麻烦。
最佳答案
So I know GridView is depreciated
GridView
根据 the JavaDocs 未弃用The Android Studio client says it has been depreciated in favor of ConstraintLayout
GridView
和 ConstraintLayout
不是等价的东西,所以推荐没有意义。GridLayout
相当于 ConstraintLayout
. GridLayout
也是not deprecated .but is it okay to use GridView for production code?
两个
GridView
和 GridLayout
在生产代码中使用是安全的。它们已经过时了,我不建议任何人使用它们,但它们是安全的。GridView
, 虽然 RecyclerView
和 GridLayoutManager
会是更好的选择GridLayout
或者也许 TableLayout
, 虽然 ConstraintLayout
会是更好的选择关于android - 在 Android 中使用 GridView 是否安全?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57225567/