简体   繁体   English

如何在iOS中关闭Popover视图

[英]How to dismiss the Popover View in ios

I have 4 buttons in my app.If i click on first button Popover view will come.when i press on the screen that Popover view will disappear.(This is first method.It is working fine) 我的应用程序中有4个按钮,如果我单击第一个按钮,则会出现Popover视图。当我在屏幕上按一下时,Popover视图将消失(这是第一种方法,可以正常工作)

Second Method If i click on first button popover view will come and next if i click on the 2nd button that Popover View should automatically has to disappear and the second button Popover View has to come. 第二种方法如果我单击第一个按钮,则弹出视图将出现;接下来,如果我单击第二个按钮,则该弹出视图应自动消失,而第二个按钮必须出现。

But for me it is not coming like that.If i click on the 2nd button it disappearing the 1st button Popover View and not displaying the 2nd button Popover View. 但是对我来说不是那样的。如果我单击第二个按钮,它将消失第一个按钮的“ Popover View”,而不显示第二个按钮“ Popover View”。

I am new to Objective-c ,Can anyone please help to solve this problem? 我是Objective-c的新手,有人可以帮助解决此问题吗?

Thanks in Adavnce 感谢Adavnce

I don`t understand you problem very well, but i hope this helps, on the method that call the pop over. 我不太了解您的问题,但是我希望这对调用弹出窗口的方法有所帮助。

- (void)callMyPopOver 
{
    if (self.firstPopOver != nil) 
    {
        [self.firstPopOver dismissPopoverAnimated:NO];
    }
    //call your second pop over..
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM