I have an activity that has an ImageView defined inside a HorizontalScrollView. The image source is a 9-patch file that is constrained to stretch only the right edge to fill
9-patch images seem to only work when they're set as a View's background image. So:
android:src, set android:background in your layout XML, andsetBackgroundResource() when you want to change the image.You can also use a plain View instead of an ImageView if you want; it doesn't really matter much.