search

Home  >  Q&A  >  body text

ios - Multiple ImageView controls display problem

ios I added 1000 ImageView controls using code in the ViewController control. Anyway, there are many
ImageView controls.

But when debugging, I found that only more than 10 ImageView controls can be displayed in the ViewController control, and the others are below. The ViewController control cannot be scrolled or pulled down, and all the ImageView controls below cannot be seen.

May I ask the masters, is there any way to make the ViewController control scroll, or is there any way to make a view control store a large number of controls, and all can be seen, similar to QQ, where you can scroll and see a lot of text and pictures. .

给我你的怀抱给我你的怀抱2796 days ago791

reply all(4)I'll reply

  • 大家讲道理

    大家讲道理2017-05-17 10:08:32

    1. You can put all the pictures directly on the UIScrollView and set its contentSize height to the sum of the heights of all pictures.
    2. You can also use UITableView to put a picture in each cell
    3. You can also use UICollectionView to put a picture in each cell

    reply
    0
  • 巴扎黑

    巴扎黑2017-05-17 10:08:32

    Put it inside UIScrollView.

    reply
    0
  • 巴扎黑

    巴扎黑2017-05-17 10:08:32

    If there is a lot of imageView space, it is recommended to use UITableView or UICollection to solve it and reuse cells, otherwise the memory will explode.

    reply
    0
  • 我想大声告诉你

    我想大声告诉你2017-05-17 10:08:32

    It is recommended to use UITableView or UITableView as a container so that the view can be reused.

    reply
    0
  • Cancelreply