建立在Android的空绘制对象 [英] Creating an empty Drawable in Android

查看:121
本文介绍了建立在Android的空绘制对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

创建一个可绘制对象是完全空似乎是一个共同的需要,作为占位符,初始状态等,但似乎没有成为一个很好的办法做到这一点......至少在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.

这篇关于建立在Android的空绘制对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆