How to add layers to the view?

I am going to develop a program for Android, with a photo on the screen. And above the image there is text and a picture (circle / rect). Text and pattern will change when using a touch on the screen. How can i implement? SurfaceView? ItemizedOverlay? or something else?

Pls. consult. thanks all :)

+3
source share
1 answer

Elements in FrameLayout or RelativeLayout will overlap (unless you specifically position something higher / lower / left / right of something else inside RelativeLayout). It is best to do what you want, make a RelativeLayout with the background image of your photo (or ImageView as your first child), and then place your text elements and form Drawables as children of the RelativeLayout. You can resort to doing all this with a custom view and draw directly on the canvas yourself, but I would not recommend this if you really don't need to.

Also see this SO message for overlapping images.

+4
source

Source: https://habr.com/ru/post/1746388/


All Articles