UIButton在分组表视图下面 [英] UIButton underneath grouped table view

查看:102
本文介绍了UIButton在分组表视图下面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基本上,我想在分组表视图下创建一个按钮,例如contacts.app必须删除联系人。

Basically, I want to create a button underneath a grouped table view, like contacts.app has to delete contacts.

我可以创建按钮,我'我只是有点疑惑如何决定放在哪里。

I can create the button fine, I'm just a bit puzzled as to how to decide where to put it.

我以为我可以做:

CGRect bounds = [[self tableView] bounds];

然后根据该按钮放置按钮。

Then place the button based on that.

然而,当访问bound.height的边界时,我得到零!有没有动态的方法来检索我可能缺少的tableView的高度?

However, when accessing the size.height of bounds I get zero! Is there a dynamic way to retrieve the tableView's height that I could be missing?

非常感谢任何帮助。

Rich

推荐答案

您可以创建按钮的大小,如

You can create the size of your button like

CGRect buttonFrame = CGRectMake(0, 0, width, height);

创建具有该框架的按钮,然后将按钮设置为 tableView 的页脚

Create the button with that frame, and then set the button as the tableView's footer

myTableView.tableFooterView = myButton;

这篇关于UIButton在分组表视图下面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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