aleksikallio
aleksikallio

Reputation: 1932

Android: Background with specific size?

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

Upvotes: 1

Views: 588

Answers (1)

NebulaFox
NebulaFox

Reputation: 8313

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.

Upvotes: 1

Related Questions