Add same subview multiple times to view

后端 未结 1 1358
心在旅途
心在旅途 2021-02-01 04:41

I don\'t know if this is possible, but what I would like to do is add a subview several times to the view. I have tried something like this:

[self.view addSubvie         


        
1条回答
  •  我在风中等你
    2021-02-01 04:55

    A view can only be contained in a single parent view's hierarchy. As soon as you add it to a new one, it is removed from the previous one. In this case, it is being removed and added back to the same view's hierarchy. You would need to make a copy of the sub-view to have it appear multiple times.

    0 讨论(0)
提交回复
热议问题