当前位置: 动力学知识库 > 问答 > 编程问答 >

android - What the heck is wrong with this png file?

问题描述:

So I have a simple small PNG file with a transparency on it. I have it setup as a ImageButton and it will not display the image at all. I'll swap it with a different one with the exact same size and dimensions (different name) and it displays normally. I then tried changing the name of this PNG, no luck. I resaved the PNG as a PNG, still no luck. I tried using the PNG in a ImageView in a different activity. For whatever reason, Eclipse will display it fine but not in the emulator or handset.

Just some quick info: The pngs are in Photoshop, I use the Save for Web and Devices to save the PNG-24 with transparency on both images.

Question is, why? Here are the files: add.png does not work, but the search.png does.

网友答案:

I used your add PNG in an ImageView and it worked perfectly fine. Sometimes cache can cause these weird anomalies with Android, as I have experienced it often with images. You can try deleting the \bin\resources.ap_ file and \bin*.apk file, then rebuild your project and it should resolve.

分享给朋友:
您可能感兴趣的文章:
随机阅读: