开发者

UIView remove itself from UIScrollView

Following Scenario:

I have a = UIViewController A that contains a UIScrollView

I have a second UIViewController "B" (amongst other thi开发者_JAVA百科ngs it contains a button) and add it to the ScrollView of A

myView *mView = [[myView alloc] init]; [myScrollView addSubview:mView.view];

Is there a way that once the button is pressed that it(view) removes itself from the scrollview?

I thought in the direction of setting the delegate of mView to "A" ?! But not sure how that should work in detail....

Any suggestions? Thanks!


In the controller, you can call:

[self.view removeFromSuperview];


If you have a reference to view you can do the following:

[view removeFromSuperview];

If you don't have a reference, please post more code and I can modify my answer for you.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜