创建类似于联系人应用程序的编辑视图 [英] Create an Edit view similar to Contacts App

查看:47
本文介绍了创建类似于联系人应用程序的编辑视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序中有一个编辑视图,它是UITableViewController的一个实例,并且在分组表中包含一个带有文本字段的单元格.

I have an edit view in my app which is a instance of UITableViewController and contains one cell with a textfield in a grouped table.

此单元格目前位于屏幕顶部,并且是firstResponder,因此它们的键盘也可见.但是,在所有Apple应用程序(如通讯录应用程序)中,当您编辑一条信息(如电子邮件)时,它的两行都位于导航栏和键盘之间的中间位置,而不是位于屏幕顶部.

At the moment this cell is at the top of the screen and is firstResponder so they keyboard is visible as well. But in all the Apples apps like the Contacts App when you edit a piece of information like an Email it buts both of its rows in the middle between the Nav Bar and the Keyboard not at the top of the screen.

我如何实现这种效果?

非常感谢

推荐答案

在IB中,在表视图的Size Inspector上,将Content Inset设置为50,或者在代码中执行以下操作:

In IB, on the Size Inspector for the table view, set the Content Inset to say 50 or in code do this:

tableView.contentInset = UIEdgeInsetsMake(50.0, 0.0, 0.0, 0.0);

这篇关于创建类似于联系人应用程序的编辑视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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