I set the background for ListView

listView.setBackgroundResource(R.drawable.documents_delete); 

How can I align the image in the center of the background to its original size and, in principle, change the settings of the background image?

    1 answer 1

    You have 2 options:

    1. Create an xml-drawable to put the image in the bitmap tag. So she will be able to set a couple of parameters, incl. center placement.

    2. Do not use the background, but put your markup under the ListView (which is with a transparent background). You can do anything in your markup.

    • And you can still score on this thing at all, because the lists tend to stretch :) And pictures like everything in this case take the property of ugliness: D - Flippy
    • @Flippy, the lists should not be stretched) They should have a static height / width and only scroll the content in themselves) So there should be no stretching when using kosher) - YuriySPb
    • Exactly, exactly) I did not think .. - Flippy