gpt4 book ai didi

android - 在 Android 中创建一个空的 Drawable

转载 作者:IT王子 更新时间:2023-10-29 00:00:42 27 4
gpt4 key购买 nike

创建一个完全为空的 Drawable 似乎是一种常见的需求,作为占位符、初始状态等,但似乎没有一个好的方法来做到这一点……至少在 XML 中。有几个地方引用了系统资源 @android:drawable/empty 但据我所知(即,它不在引用文档中,并且 aapt chokes 说它找不到资源)这不存在。

是否有一种通用的方法来引用一个空的 Drawable,或者你最终会为每个项目创建一个假的空 PNG?

最佳答案

对我来说,当我在制作空的可绘制对象时尝试使用 @android:id/empty 时它不起作用。对我来说,@android:color/transparent 就是其中之一。

关于android - 在 Android 中创建一个空的 Drawable,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2234292/

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