【问题标题】:remove all objects from scrollview从滚动视图中删除所有对象
【发布时间】:2012-05-14 19:36:07
【问题描述】:

如何从 UIScrollView 中移除所有对象(完全清除滚动视图,不管里面分配了什么):

我试过了,但它不起作用:

for (UIView *subview in scroll1.subviews) {
    [subview removeFromSuperview];
}

【问题讨论】:

标签: objective-c xcode


【解决方案1】:

您是否尝试过此帖子答案中发布的代码?

Remove all the subviews from a UIScrollView?

希望对你有帮助

【讨论】:

  • 谢谢,这有效:[scrollView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
猜你喜欢
  • 2015-12-04
  • 1970-01-01
  • 2010-11-21
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多