开发者

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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜