如何放置(在导航栏和NOT)以上的UITableView按钮? [英] How to place buttons above UITableView (and not in navigation bar)?

查看:235
本文介绍了如何放置(在导航栏和NOT)以上的UITableView按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新iPhone编程。我此刻学习的UITableView。我需要创建一个具有上表视图按钮(但不是在导航栏)想在这个应用程序的应用程序(最近,支持...):

I am new to iphone programming. I am learning uitableview at the moment. I need to create an app that has buttons above table view (but not in the navigation bar) like in this app (recent, support, ...):

这是如何实现的这里,是按钮表的标头的一部分?是否有可能调用函数后,上面的tableview有人presses按钮重新绘制新的数据的tableview。它是怎么做的?

How is this achieved here, are buttons part of table's header? Is it possible to call a function to redraw tableview with new data after someone presses button above tableview. How is it done?

感谢您。

推荐答案

创建一个新的视图控制器,但不检查的UITableViewController子类的框。
在IB,拖一个UITableView到视图,并使其开始下面的导航栏约44像素。
然后拖动按钮进入该空间。声明IBOutlet中的变量在.h文件中,并钩起来。

Create a new view controller, but don't check the box for UITableViewController subclass. In IB, drag a uiTableView onto the view and make it start about 44 pixels below the Nav Bar. Then drag buttons into that space. Declare your IBOutlet variables in your .h file, and hook them up.

有关你问题的第二部分:有按钮调用一个IBAction为,并且有方法调用

For the second part of your question: have the button call an IBAction, and have that method call

  [myTableView reloadData];

这篇关于如何放置(在导航栏和NOT)以上的UITableView按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆