0

My linearLayout backgroud is losing is patch 9 effet after the imageView is load from a dynamic Url

the only way to fix the problem is to use holder.imgView.setScaleType(ImageView.ScaleType.FIT_XY); but i don't want to stretch the image at the same time

<LinearLayout
android:id="@+id/llPatch"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@drawable/testt1"
    android:orientation="vertical" >

        <ImageView
            android:id="@+id/imageRecette"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_margin="0dp"
            android:padding="0dp"
            android:src="@drawable/tartare" />

</LinearLayout>
Treping
  • 59
  • 8

1 Answers1

1

9-patch images are compiled with the project (from your res folder).

You can see how a compiled 9-patch looks like if you add one to a project, build it (the project) and look in bin/res/[where your image is at]/[image name].9.png

So you can't load a 9-patch image (with the lines on the sides) from a url.

You can however upload a compiled 9-patch to your server, download it and use it as specified here: https://stackoverflow.com/a/10639923/876603

Community
  • 1
  • 1
dors
  • 5,802
  • 8
  • 45
  • 71
  • the patch9 is associate to my LinearLayout android:background="@drawable/testt1", it the image View that is load from a URL – Treping Jun 28 '13 at 16:44