Aman Grover
Aman Grover

Reputation: 1641

How to place 9patch generated images in Android Studio?

enter image description here enter image description here

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

enter image description here

Upvotes: 1

Views: 2019

Answers (2)

CommonsWare
CommonsWare

Reputation: 1007534

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.

Upvotes: 2

Prokash Sarkar
Prokash Sarkar

Reputation: 11873

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

enter image description here

Original post: Add 9-patch image to Android Studio

Upvotes: 2

Related Questions