ios - 隐藏/关闭 View Controller

标签 ios objective-c uiview popover

我的 iPhone 项目上有一个 Popover:

popover screenshot

当我点击一张小图片时会出现:

-(void)tapDetected:(UITapGestureRecognizer *)sender
{
    UIImageView *iboImageView = sender.view;
    UITableView *tableView = (UITableView *)iboTableView;
    NSIndexPath *index = [NSIndexPath indexPathWithIndex:iboImageView.tag];
    MovieCell *cell = (MovieCell *)[tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:iboImageView.tag inSection:0]];
    [ApplicationManager getInstance].currentMovie=cell.nameLabel.text;

    DemoTableController *controller = [[DemoTableController alloc] initWithStyle:UITableViewStylePlain]; //This is my popover controller (what is displayed inside popover )
    FPPopoverController *popover = [[FPPopoverController alloc] initWithViewController:controller];
    popover.contentSize = CGSizeMake(150,158);
    [popover presentPopoverFromView:cell.iboPopImage];
}

当我按下一个单元格时,我想折叠弹出框。有没有类似self.close的东西?

最佳答案

来自 FPPopoverController.h 文件:

/** @brief Dismiss the popover **/
-(void)dismissPopoverAnimated:(BOOL)animated;

/** @brief Dismiss the popover with completion block for post-animation cleanup **/
typedef void (^FPPopoverCompletion)();
-(void)dismissPopoverAnimated:(BOOL)animated completion:(FPPopoverCompletion)completionBlock;

使用这些方法中的任何一个来关闭 Controller 。

关于ios - 隐藏/关闭 View Controller ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19540819/

相关文章:

ios - 无法从代码添加 SSRadioButtonsController 单选按钮标题

objective-c - 编辑 TableView 中的行时触发方法

objective-c - 这是什么类型的 XML 文件?

iphone - 执行多个连续 UIView 动画的最佳方法?

ios - 打开应用程序时底部工具栏不见了?

ios - 操作无法完成。对等方重置连接

ios - 在单元格中异步加载图像的 UITableView - 图像在慢速连接时不断变化

即使我正在释放,iPhone 应用程序也会由于收到内存警告而崩溃

ios - 为 `intentdefinition` 中定义的 Intent 自动生成的代码抛出 `No newline at end of file`

ios - 在导航栏中嵌入 CGRect