iPhone-Alertview中的东西 [英] iphone - stuff inside alertview

查看:51
本文介绍了iPhone-Alertview中的东西的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的应用程序中有一个部分,向用户展示用户,他们创建的文件以及存储在应用程序目录中的文件.我想允许用户重命名文件.

I have a part on my app that I show the users, the files they have created and have stored inside the app's directory. I want to allow the users to rename the files.

我很想这样做:

  1. 用户选择一个文件
  2. 用户点击重命名"按钮.
  3. 弹出一个警报视图,显示旧名称,并在文本视图中供用户键入新名称.

我的问题是:这是苹果公司的祝福吗?这听起来像是对Alertview的入侵.

My question is: is this blessed by Apple? This sounds like a hack to the alertview.

该应用将被批准吗?

我在Google上四处搜寻,对此我有不同的看法.

I googled around and I saw mixed opinions about that.

谢谢

推荐答案

通常,我认为正确的HIG-happy UI将是带有文件列表的UITableView.用户点击并单击编辑"按钮,页面行变为可编辑状态,从而允许您删除行/文件(带有验证警报)以及显示详细信息视图的显示箭头,您可以在其中更改名称.

Generally I think the correct HIG-happy UI would be a UITableView with the list of of files. The user taps and Edit button and the page rows become editable, allowing you to delete a row/file (with a verification alert) and a disclosure arrow that pushes a detail view where you can change the name.

一种替代方法(尽管不是HIG友好的)是在UITextField中显示文件名,其中 borderStyle 设置为 UITextBorderStyleNone 已启用设置为 NO .当用户点击重命名"按钮时,将 borderStyle 更改为 UITextBorderStyleRoundedRect enabled 设置为 YES ,将firstResponder设置为到文本字段,因此光标在textField中闪烁.您需要确定取消按钮.

An alternative, though not HIG-friendly, is displaying the file name in a UITextField where the borderStyle set to UITextBorderStyleNone and the enabled set to NO. When the user taps the Rename button you change the borderStyle to UITextBorderStyleRoundedRect and enabled set to YES, setting the firstResponder to the text field so the cursor is flashing inside the textField. You'd need OK and Cancel buttons.

或者您可以向UIAlertView添加文本字段,也可以针对HIG,但可能更好.

Or you could add a text field to the UIAlertView, also against the HIG but perhaps better.

这篇关于iPhone-Alertview中的东西的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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