Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我想擦除一个子视图,当我放置 mysubview.alpha = 0; 时是否完成?还是我必须做其他事情?谢谢!
如果您只想删除它,请使用
[mySubview removeFromSuperview];
要“擦除”一个子视图,只需释放它;)如果你把它的 alpha 值设置为 0,它只是隐藏的。正如评论中所说,您还必须将其从 superview ( [myView removeFromSuperview]) 中删除。
[myView removeFromSuperview]
只需使用:-
[*yoursubviewname* removeFromSuperView];