简体   繁体   中英

How to place 9patch generated images in Android Studio?

在此处输入图片说明 在此处输入图片说明

I used the freely available Simple 9patch generator available online, to generate a logo for my app's splash screen. But how do I place it in Android Studio drawable folder? Do I have to make separate drawable folders like ldpi , hdpi etc? I tried that but when I try to set the image on a layout, it gives me an error saying

Cannot resolve symbol @drawable/something

在此处输入图片说明

You need to make sure, you have place the images in the correct folder. Here's an example,

在此处输入图片说明

Original post: Add 9-patch image to Android Studio

Get rid of the .9 in @drawable/splash.9 . It is just @drawable/splash . .9.png is the file extension, and file extensions are not used in references to resources.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM