views:

50

answers:

1

Hi all,

I'm having some trouble trying to create a program for Android 2.1-update1 with a background of a specific size. It seems that the only option is to scale the image according to the device screen size/orientation.

Is there a way to create an empty LinearLayout (edit: with a specific size) behind the gui widgets and then set the image as the background of this layout?

-- onik

+1  A: 

Yes, by using setBackgroundResource(int), which sets a drawable resource to use as background, which can be coded as android:background or, setBackgroundDrawable(Drawable), which sets a Drawable to use a background. I am just not sure how it will work with a specific size.

kuroutadori
Thanks, but I'm currently using the android:background="@drawable/bg" method, and this does not appear to support sizing of the image. Therefore, orientation changes wreck the ui since the bg rotates with it.
onik