建立在Android的空绘制对象对象、Android

2023-09-05 01:40:28 作者:十年久不遇

创建一个可绘制对象是完全空似乎是一个共同的需要,作为占位符,初始状态等,但似乎没有成为一个很好的办法做到这一点......至少在XML。一些地方指的是系统资源 @android:绘制/空,但据我所知(即,它不是在参考文档和AAPT扼流圈说,它可以'吨找到资源)此不存在

Creating a Drawable that is completely empty seems like a common need, as a place holder, initial state, etc., but there doesn't seem to be a good way to do this... at least in XML. Several places refer to the system resource @android:drawable/empty but as far as I can tell (i.e., it's not in the reference docs, and aapt chokes saying that it can't find the resource) this doesn't exist.

有没有引用一个空的绘制对象的一般方式,或者你最终会创建一个假的空PNG每个项目?

Is there a general way of referencing an empty Drawable, or do you end up creating a fake empty PNG for each project?

推荐答案

对于我来说,当我试图@android使用没有奏效:ID /空制作时一个空的绘制。对我来说, @android:彩色/透明是一个

For me it didn't work when I tried to use @android:id/empty when making an empty drawable. For me, @android:color/transparent was the one.