iOS 8今日视图扩展与UITableViewController不显示页脚(UIView)

时间:2015-03-12 21:30:06

标签: ios objective-c uitableview uiview ios8-today-widget

在与Core Data + Extensions(共享数据)进行摔跤后,我终于开始工作,数据共享正常。现在,在我的UITableViewController(在我的今日扩展中)中,我想要一个带有按钮的常量页脚视图来打开应用程序,但我无法显示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;
}

1 个答案:

答案 0 :(得分:0)

根据Apple的说法,“提供”打开应用程序“按钮并不是一个好主意”所以我根本不会这样做。根据相应的文档,它最好是a)将其编码到哪里,如果你点击小部件,它打开你的应用程序,或b)有一个通用元素来打开你的应用程序在“聚焦”视图。

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

相关问题