iOS 8 Today View Extension with UITableViewController 不显示页脚



在与核心数据+扩展(共享数据)搏斗了一整天之后,我终于让它工作了,数据共享得很好。现在,在我的 UITableViewController 中(在我的 Today 扩展中),我想有一个带有打开应用程序的按钮的常量页脚视图,但我无法显示 UIView。我尝试过以编程方式和通过 IB 执行此操作。 有什么想法吗?

- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
    UIView *footerView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 320, 44)];
    UIButton *openButton = [[UIButton alloc]initWithFrame:CGRectMake(footerView.frame.origin.x, footerView.frame.origin.y, 300, 30)];
    [footerView addSubview:openButton];
    return footerView;
}

根据苹果的说法,"提供"打开应用程序"按钮不是一个好主意",所以我根本不会这样做。根据相应的文档,最好 a) 将其编码到如果您点击小部件,它会打开您的应用程序,或者 b) 有一个常规元素以在"聚焦"视图中打开您的应用程序。

来源: https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/AppExtensions.html#//apple_ref/doc/uid/TP40006556-CH67-SW4

最新更新