Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 235
Registered: ‎12-13-2011
My Device: Curve 9380
My Carrier: Vodafone-IN

Re: BlackBerry Nine-Patch library

it thows the exception
java.lang.IllegalArgumentException: width/height must be positive
Highlighted
sdw
Contributor
Posts: 29
Registered: ‎05-30-2011
My Device: Developer
My Carrier: N/A

Re: BlackBerry Nine-Patch library

Without a stack trace I can't tell for sure, but my guess is that the bitmap you are providing in the constructor is not a properly formatted nine patch image. If the image is smaller than 3 pixels by 3 pixels, you will definitely get that exception.

You might refer to this document to understand the nine patch format:
http://developer.android.com/guide/topics/graphics/2d-graphics.html#nine-patch

Or a simple web search for "android nine patch" should turn up other references.

Please note that the version for BlackBerry is not as fully featured as the version for Android. Specifically, the BlackBerry version does not support multiple stretch areas. You can also read more about the library here: http://www.mobiata.com/blog/2011/10/25/building-the-flighttrack-ui-on-blackberry

Hope that helps!