You can also add imageviews dynamically in the Java code. Scrollviews can only have one child, so you would first add a linear or relative layout as the scrollview's child. Then in the Java code, bind that layout to an object using findViewById, create a new ImageView, and use the addView method from the layout object.