0

I have this image:

enter image description here

and I want to assign this image to the divider property of a listview. The problem is the image expand all the width, and when I execute this app in a device the image is two horizontal lines, instead of two points.

This my XML code:

<com.handmark.pulltorefresh.library.PullToRefreshListView 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/pull_refresh_list"
    android:layout_width="wrap_content"
    android:layout_height="fill_parent"
    android:cacheColorHint="#00000000"
    android:divider="@drawable/divider_list_view"
    android:dividerHeight="4dp"
    android:fadingEdge="none"
    android:fastScrollEnabled="false"
    android:footerDividersEnabled="false"
    android:headerDividersEnabled="false"
    android:scrollbars="none"
    android:paddingLeft="5dp"
    android:paddingRight="5dp" />

Here's my 9.png:

enter image description here

beni
  • 3,019
  • 5
  • 35
  • 55

2 Answers2

0

Its is not possible to change the width of list divider because its flow is manage by os framework.

Abhijit Chakra
  • 3,201
  • 37
  • 66
0

I don't know for sure i never tired it, but a possible idea, try to make a 9patch image from your image with extra transparency, at let the system stretch the invisible part of your image.

Alex
  • 3,382
  • 2
  • 32
  • 41