In android studio,you can edit 9 patches directly from with the IDE. But is it also possible to convert an png image to 9-patch using the IDE? (similar to the android 9-patch tool provided by the SDK).
Well I don't think there is any tool in Android Studio
but you can do this by Android Asset Studio
Android Asset Studio Simple Nine-patch Generator
This is a very handy tool to create simple 9 patch
images for all dpi
with a clean user interface.
If you rename the resource from *.png
to *.9.png
then in Android Studio you may edit it with 9 patch (a tool provided with the Android SDK).
Android Studio now has this option available by right-clicking on the image file in your res folder, then selecting Create 9-Patch file
. You can then open the newly created 9-patch file and start editing!
Update: Android Studio now has a feature that can be used to generate 9patch images.
To do this navigate to /home/android-studio/data/sdk/tools
on your terminal
and run draw9patch
.
© 2022 - 2024 — McMap. All rights reserved.