Using an image as the parent Activity (interface)
Is it possible to use an image as the background of the main Activity? (load screen). I then want to put buttons over the image. If this is possible could anyone tell me how I would loa开发者_StackOverflow社区d the image into my main Activity? Or send me to a site that would go over this?
Thanks :)
I use the following to set a background image for an Activity..
View view = getWindow().getDecorView();
int orientation = getResources().getConfiguration().orientation;
if (Configuration.ORIENTATION_LANDSCAPE == orientation) {
view.setBackgroundResource (R.drawable.bground_land);
} else {
view.setBackgroundResource (R.drawable.bground_port);
}
bground_land.jpg
and bground_port.jpg
are images in my project's /res/drawable directory.
精彩评论