开发者

iphone - stuff inside alertview

开发者 https://www.devze.com 2023-01-30 05:25 出处:网络
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.

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.

I am wondering of doing this:

  1. The user selects a file
  2. The user taps on the RENAME button.
  3. An alertview pops showing the old name and having a textview where the user can type the new name.

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

Will the app be approved?

I googled around and I saw mixed opinions about that.

thanks


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.

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.

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


I don't know if the property alertViewStyle was available when you make this question but searching to resolve this problem for me, I found that setting this property with UIAlertViewStylePlainTextInput resolve your problem.


Yes it is in iPhone sdk alertBox, alertBox can have the textField in which you rename the file.

check this link

for making such kind of stuff. No problem in accepting your app


You could either subclass UIAletView and add your own initWithTitle:message:...etc. method, as outlined in this tutorial, or use the undocumented [alert addTextFieldWithValue:@"" label:nil]; method, which is easier but may cause Apple to reject your app.

0

精彩评论

暂无评论...
验证码 换一张
取 消