Put a Image over an activity
How I can put an image over an activity (something like the image below) but with the buttons and other widgets under this image receiving the touch events?
image http://images.macworld.com/appguide/images/androi开发者_开发技巧d/558/2908791394402692/5582908791394402692_1.jpg
You can create a transparent Activity
like this How do I create a transparent Activity on Android? and make a Layout with a fullscreen ImageView
I solve the problem override the draw function.
public class TutorialLinearLayout extends LinearLayout {
public TutorialLinearLayout(Context context) {
super(context);
}
@Override
public void draw(Canvas canvas) {
super.draw(canvas);
Bitmap tutorial = BitmapFactory.decodeResource(getResources(), R.drawable.tutorial);
canvas.drawBitmap(tutorial, 0, 0, null);
tutorial.recycle();
}
}
精彩评论