if( [selfviewWithTag:789] ){ //如果tag为789的视图存在
[[selfviewWithTag:789]removeFromSuperview];
}
具体有待研究
官方对 viewWithTag 的解释是这样的
|
Returns the view whose tag matches the specified value. | |
|
This method searches the current view and all of its subviews for the specified view. |
在这里也顺便说一下,每个视图都可以设置tag 不仅仅包括Button 还有 view imageview等等
返回其标记匹配指定值的视图。
此方法搜索当前视图及其所有子视图指定的视图。
本文介绍了如何使用viewWithTag方法来查找并移除特定标记的视图。这种方法可以方便地管理界面上多个视图组件。
6640

被折叠的 条评论
为什么被折叠?



