Ok, we assume that now we can't add subviews in AlertViews since ios7. But when we need to popup a new little view for the user to input some data, what we have to do ? What apple says we have to do now ?
You can create your own custom alert.
I explain here a way how to do that.
Related
Dimming the background upon showing an UIAlertView seems the default behavior of iOS. Can I disable this effect so that the background will not be dimmed, because I have a rather dark background already. Thanks!
UIAlertView doesn’t provide a way to do that. If you need that behavior, you’ll have to find a third-party alert view that does or create your own custom one.
You can't do that with the built-in UIAlertView class from Apple. Try checking out this custom alert view class, although you will need to further customize it to remove the background on the pop-up. Other than that, you could make a custom class from scratch.
I am programming a text-based RPG for Voice-Over users on the iPhone.
I've got multiple UIViews added to my viewcontroller for different events.
I often remove and add them to my main View.
My Question is as follows: is it possible to update the VoiceOver Cursor to focus on the first Element on the View so the User doesn't has to check every Time if there has happened something new?
I figured out that this happens in a Navigationcontroller.
Is there a functionality to do this?
By posting a UIAccessibilityLayoutChangedNotification, you inform VoiceOver that the layout of the screen has changed. You can also use UIAccessibilityAnnouncementNotification if you want to make a specific announcement.
UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification, nil);
Reference: UIAccessibility Protocol Introduction, Notifications
You can't control the VoiceOver cursor in iOS 4 or 5. I wish you could, it would solve so many issues.
I think this will be possible with iOS 6. See this answer for more info on that: https://stackoverflow.com/a/11995385/1455770
I have a problem with my iPad app.
I perform authorization in social networks (facebook, twitter etc.) to post information from app. Several webviews change each other (login, content of post, captcha). They have text fields and I have to show keyboard. After posting I return to some start view with posted information.
It works good, but after posting first news something goes wrong. When I post news one more time, after return keyboard is still on the screen.
I saw here some questions familiar to this, but they wasn't useful.
I tried to make resignFirstRersponder to all webViews, textFields and textViews. Also i\I tried to implement method disablesAutomaticKeyboardDismissal but it doesn't help me.
I don't know where search for problem...
So questions are: why could this happened? How can I solve this? fnd How can I get some information about keyboard? (is it visible, what object has focus etc., anything that could be useful to solve problem)
And one more thing. I have similar app for iPhone and it seems to work correct.
Try this:
[searchBar performSelector:#selector(resignFirstResponder) withObject:nil afterDelay:0.1];
Make sure to replace searchBar with the object that is the actual First responder in your case
Problem is fixed, finally. The reason was the way I had changed visible view. I set a new value to view property of ViewController. And as previous view contains text field with focus on it, focus wasn't lost before changing view (and keyboard was still on the screen), but I had lost handler to previous view.
Solution is: resignFirstResponder to all (or current) inputs BEFORE changing view.
Hope, it's clear. Thanks for your help!
Im looking for some help regarding to put a save like confirmation if some changes where made to a UITextField and UISegmentedControl.
Can I prevent the UINavigationController from pop the view? And then pop based on buttons in a AlertView?
I use the UITextField and UISegmented control to POST data to a webservice.
I perhaps need to use a modalView for this? but wanted first to see if someone have another idea, because I would like to keep navigation clicks down if possible.
Any suggestions for this?
Thanks,
Why not just using a UIAlertView?
EDIT: On second thought, and re-reading your question + comment, I would recommend to use a Modal View with classics OK/Cancel buttons + a UIAlertView(s) for confirmation(s). (UIAlertView "poping" on OK/Cancel is easy to do via UIAlertViewDelegate)
That's what Modal views are for, block UI until some user action has been completed. Like a form. This is how I do all my forms, and how Apple does (just look at the create mail screen for an example, or any form of iOS apps)
Adding a "Magical" action requiring user interaction on the back button of a navigation controller is bad in terms of user experience, if you hit back, you expect the view to pop, nothing else. I would then be surprised if Apple SDK even allows to cancel that event...
You can do what you would like without the need of a modal view.
First, you can use your text field's UITextFieldDelegate to set a flag in your controller when the field content is modified. You can reset this flag when the data is sent out.
Then you could override your UIViewContorller's viewWillDisappear to show an alert to the user in case new data have not been posted at the moment the view is going to disappear and give him the possibility of sending it to the server. This method will be called when you move to a different controller in your navigation UI, and you will not have a chance to "reject" the operation.
I did a simple application.
My application contains 10 Text fields.
what i need is i need to hide default keypad i place manual keys like this
How can i done this keys works as a keypad to my app.
can any one pls post some code or link.
Thank u in advance.
I wrote a KeyPad, that is easy to customize via its delegate.
Just add a view with 10 buttons and assign action for each of them.
In the didBeginEditing method diss the keyboard using,
[textField resignFirstResponder]
[yourKeyboard show];
And i think apple will reject the applications using custom keyboard
There is a complete thread about that here
It has a tutorial, lots of comments, sample code and project, everything you need is there. (Is quite long though)
You basically create a view with your buttons for example and
In iOS3.2 and above you can use inputView property of your textField.
In early iOS versions you have to do a trick (add your keyboard as a subview of UIKeyboard) that is also written in the link.
If you need more advanced stuff than simple numbers, you probably want to look at UIKeyInput and UITextInput protocols.
Hope it helps