The application has a lot of pictures, they all do not fit on the screen, I decided to do scrolling. And here there is a small problem: I place scroll vertical on it layout vertical, then the images are arranged in one column, the question is very primitive, but I can’t think of it. How to scroll RelativeLayout? enter image description here

enter image description here

  • How do widgets communicate in RelativeLayout and in general where is the markup? To whom are these pictures and what can they say about your problem, you didn’t think? - they are useless. - pavlofff
  • 2
    If you need a dynamic list, use ListView or RecyclerView. If you just need to put a bunch of static images on the screen, then use the ScrollView container - Alexander Uymanov am
  • There was a studio bug, Relative did not fit on the scroll, after restarting everything is ok. Thanks to all! - anarbus

2 answers 2

Well, take your RelativeLayout with images, and put in the ScrollView instead of LinearLayout . Any ViewGroup can be a container in ScrollView

    If you have a lot of pictures like this, you seriously risk getting OutOfMemory, or at least the brakes on weak devices. For this purpose, I would recommend that you still use a ListView (or better yet RecyclerView), regardless of whether you have a static data set or a dynamic one. So you can implement the ViewHolder pattern, which saves device resources.