【问题标题】:Hide/Close ViewControllers隐藏/关闭视图控制器
【发布时间】:2013-10-23 11:47:47
【问题描述】:

我的 iPhone 项目上有一个 Popover:

当我点击一张小图片时会显示:

-(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 库...

标签: ios objective-c uiview popover


【解决方案1】:

来自 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;

使用这些方法中的任何一种来关闭控制器。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-17
    • 2016-06-16
    • 1970-01-01
    相关资源
    最近更新 更多