how to remove subviews from scrollview?

后端 未结 8 2228
时光取名叫无心
时光取名叫无心 2020-12-02 09:10

how do i remove all subviews from my scrollview...

i have a uiview and a button above it in the scrollview something like this....

here is my code to add sub

8条回答
  •  日久生厌
    2020-12-02 09:18

    To add to what Tim said, I noticed that you are tagging your views. If you wanted to remove a view with a certain tag you could use:

    [[myScrollView viewWithTag:myButtonTag] removeFromSuperview];
    

提交回复
热议问题