Given:

Image .jpg a specific size, with a ratio of 1:10 (width: height).

What I want to get:

  • The big picture should scroll from start to finish.
  • In certain places on the big picture there should be different elements, such as: another picture (which moves back and forth animation), an input field, a viewPager.

Question:

How in a certain place of a picture to show a certain element?

    2 answers 2

    You need at the time of execution of the program to get the dimensions and coordinates of the image on the screen. After that, knowing (having tried on the layout and measuring beforehand) where the rest of the elements should be, you need to position them programmatically relative to the picture.

      To upload a large image, you need to scale it down and then upload it to ImageView.

      In this case, the picture was very large (more than 8000 in height) and it was cut into certain parts and it was already loaded into ImageView.

      As for the placement of elements on top of the image: you need to use the RelativeLayout markup, place an ImageView in it and first calculate the position of the required View - set the View values ​​(marginTop, marginLeft) to this View.