Conan Troutman · Apr 14, 2013 at 11:30 pm

Take Control of Those Pesky NinePatch Files

Everybody has a nemesis of some kind. Odysseus had Poseidon, for Captain Ahab it was the white whale, and Sherlock Holmes had Professor Moriarty. As for Android themers, well they have NinePatch (.9png) files.

If you aren’t familiar with NinePatch, check out this great tutorial which deals with the intricacies of working with these particularly troublesome image files. In summary, they are “stretchable” image files used for elements of the UI that often require resizing, such as a speech bubble used to contain a text message. Instead of storing multiple different sizes of the same image, it makes much more sense to simply resize the same one as needed, and that’s where NinePatch comes into play. Although on paper these files are an incredibly efficient solution to a problem, they can be a real nightmare to work with, as they need to be edited properly to avoid horribly misshapen and downright ugly images after the stretching takes place. And if you hadn’t already spent enough time messing around with one single file, when it dawns on you that you need to resize it for use on different screen sizes, this becomes a tempting solution to the problem.

Android Drawable Resizer by XDA Forum Member ~RoN~ should help to alleviate some of the frustration caused by these pesky images by allowing you to automatically resize the images for use on different resolutions. Once you have one size edited to your liking, simply use this Windows-based tool to specify it’s original density, select which densities you wish to create from your original, and the tool handles the rest. This is a fantastic time saver for any themers out there who aren’t afraid to tackle the NinePatch.

Check out the original thread for more information if you often find yourself spending too much time on this type of file.


_________
Want something on the XDA Portal? Send us a tip!

Conan Troutman

Conan Troutman is an editor on XDA-Developers, the largest community for Android users. Senior Moderator, Newswriter, Recovering Meme Addict. View Conan Troutman's posts and articles here.
Mario Tomás Serrafero · May 5, 2015 at 11:05 am · no comments

Microsoft Forgets Glasses and Mirror, Trashes Google

Microsoft is preparing a monumental release with Windows 10, and it could easily be one of the biggest developments in operating system history. The company’s track record in desktop OS releases saw a significant dip with Windows 8, but they did an impressive job in assembling a new strategy for this next big piece of software. By big, we mean big: the new OS will seek better integration between all things Microsoft, from the Xbox One to their Windows phones...

XDA NEWS
Jimmy McGee · May 5, 2015 at 06:00 am · 2 comments

Android System WebView Update – XDA Xposed Tuesday

Android Webview is a system component powered by Chrome that allows Android apps to display web content. Google released a security update for the pre-installed feature, but didn’t take effect on many AOSP based ROMs. However, there is no need to fear, an Xposed Module is here. In this episode of XDA Xposed Tuesday, XDA TV Producer TK reviews an Xposed Module that enables the update on AOSP based ROMs. Xposed Developer PeterCxy created the WebViewGoogle module. TK shows off...

XDA NEWS
Emil Kako · May 4, 2015 at 12:33 pm · 4 comments

Who Is Your Favorite YouTuber That Covers Mobile?

There are dozens of talented YouTubers who cover mobile, but we want to know which ones are your favorite. Let us know who your favorite tech reviewers are and what makes them stand out compared to the others.

DISCUSS
Share This