2010-03-02

How to set a background image for a controller in Android

Drawable d = getResources().getDrawable(R.drawable.pho_cellbackground);
tr.setBackgroundDrawable(d);

“pho_cellbackground” is the image name. You must include that image in ‘res’ folder in order to refer it. Image file name must be in lowercase and it is preferred that it’s in PNG format.

No comments: