Am working in message based iPhone app. I have added UITextView to show the messages typed by the user. This app allows the user to copy the messages. Whenever the user selects the messages in the bubbles the Copy option showing in middle of UITextView. How to show the Copy option in Top of the TextView?
Can anyone please help me to solve this issue? Thanks in advance.
Gopinath, this is in-built. You cannot change the default behavior. One option could be to write your own custom TextView which would show the copy option at the top. A workaround could be this:
Just let the user select the text (disable showing 'copy' in the UITextView)
You add a button at the top of the bubble
When the user selects the text & clicks on your UIButton 'copy', then copy whatever is the selection programmatically in your own method.
Related
I would like to know how to display a pop-up with some text, in an iphone application that I am developing. The part of the app I am talking about consists of some text pulled in from a plist file, all this happens in a view controller object which also consists of a button. When the user presses the button, I would like to show a pop-up window (not a small alert like the one obtained using UIAlertView but one similar to the pop-up ads that appear when you launch certain apps on the iphone, with the background dim and a window with a close button etc etc..), ya so anyway I would like to know how to achieve this, mainly if there is any pre-defined class that can make this happen. Any help would be highly appreciated. Thanks in advance.
You could use MBProgressHUD for this. You can add custom views in it and it also has the dimBackground property to dim the containing view and many other useful things.
I want to create a 4 character custom password entry like the iPhone lock screen page. It's going to have a custom designed keyboard pinpad, but thats not the question. I have 4 boxes for the entry of the pin, and each box is separated and has its own custom design. I currently have a clear UITextView on top of each box. However, I'm not really sure how to link all these together so that when I enter a number in the first box, it automatically advances to the next box so I can type the next number. After the last number has been entered, it should automatically check to see if the password is correct and if so do some action. What is the best way to do this?
When implementing UITextFieldDelegate you should check on textField:shouldChangeCharactersInRange:replacementString:
and you can move keyboard focus to next UITextField via BecomeFirstResponder documentation
So on last UITextField you will hide keyboard and disable all UITextboxes automatically, but If I were you, I would prefer to provide button to start checking pin (to let user correct pin if mistyped)
After a few hours of googlening and testing I gave up the whole autofill a form in uiwebview and will now try another approch. However, I have no idea how to make it work.
All I really wanna do is to have two buttons, "username" and "password". The user will then highlight one of the forms textfields inside the webview and then press on of the buttons and the username will be printed in the textfield (if they pushed the username button that is).
So i want help with trying to understand how to control when they are highlighting a textfiled (ofc the keyboard will show up) and how i simulate a pastefunction.
Thank you
You can modify the content of an UIWebView injecting JavaScript, there are a few topics around here about that (edit: Also check this page).
In fact, you could automatically hand the the login/password directly through a javascript submit form action, instead of having to fill the visual form.
To get the contents of the Clipboard, use:
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
NSString *pastedText = pasteboard.string;
(Note: The pasteboard is independent from your OS, meaning that if you copy something, it won't be recognized in the iphone app, you need to copy something from inside your iphone/simulator, the easiest way is to add a temporary UITextField, or go to the home screen, and get to the search page, and write there)
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:
The user selects a file
The user taps on the RENAME button.
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.
How can I display a button and/or activity indicator inside of a UITextField on the iPhone? I'm trying to reproduce Mobile Safari's location text field which contains either a reload button or a cancel (stop loading) button which is right-justified inside of the text field.
Similarly, when you click inside of the text field (not on the cancel/reload buttons) to edit the URL, a clear icon (x inside of a circle) is shown inside of the text field which will erase the contents of the text field.
How can I create this in my own apps? I cannot seem to do it via Interface Builder so I suspect it's being done in code.
There is a built in option that worked for me...check here:
Adding the "Clear" Button to an iPhone UITextField
Check out TTMessageController.