How to use dotted/dashed outline for variably sized content?
<p>Usually when I need a background that changes to match the size of the content, I would use a nine-patch image.</p>

<p>I tried that for a graphic that was transparent except for a dashed outline with rounded corners. However, it ended up stretching the dashes, instead of repeating the pattern of dashes.
The image shows three lines:
1. The basic, small image
2. How the image looks when I stretch it
3. How the image should look
<img src="http://i.stack.imgur.com/Rt6mR.png" alt="enter image description here"></p>

<p>Is there a way to do this with a nine-patch image?</p>

<p>If not, what is the recommended alternative? I think it might be possible to use shapes and XML files to simulate it, but I'm not exactly sure how to do that or how to have the corners rounded.</p>

<p>And again, the reason why I don't use a basic image is because this dashed outline would surround a box that may contain a little content or a lot.</p>
