Make keyboard get above UIAlertView? - iphone

I coded an UIWebView inside an UIAlertView, and would like the user to type something inside that webView. Unfortunately, my keyboard got covered by the AlertView.
Is there anyway to make the keyboard cover the view, not otherwise?

You can try to add observer for UIKeyboardWillShowNotification notification. And when it is displayed - simply find the keyboard inside the view hierarchy. Look here for an example. When you find it - bring it to front (maybe, do the same for keyboard parent view/views).
As far as I remember, this works only with iOS 4.0+.
And once again - listen to Jonathan Grynspan & Legolas - better think about another way of accomplishing your task.

Related

ipad keyboard resize problem

I have a "new message" view controller in my app (just like the system sms app) where there are two textfields, one for receivers and one for the message content. The problem is when I switch between the two textfields, the keyboard may resize (depending on the input method), and I don't get any keyboard notifications. This is rather embarrassing since the keyboard may cover the textfield, which is not what i want. How can I fix this?
thanks in advance.
You can set your controller as the delegate of your text fields and when textFieldShouldBeginEditing: or textFieldDidBeginEditing: is called, perform any necessary manipulations to your view to make sure the textField is visible.

iPhone/Objective-C - UISearchBar respond to touch but not display keyboard

I have a view that's used to display Comments. You can obviously comment from this view. Just like the Facebook application (checkin view) where there's a Comment bar on the bottom of the view. I would like to achieve the same functionality (not including the modal, which I've done already) when clicking on what looks like a UISearchBar.
I guess I just need to know what the best method for accepting touches are on a UISearchBar without actually having the keyboard popup (I would assume it's returning null or something on a specific delegate method perhaps?). Instead I'd like to call an action that simply presents my modal view. So I'm not actually going to allow the user to tap text into the UISearchBar, they'll do that within a UITextField on the modal.
Hope this makes sense and of course, answers are greatly appreciated.
Why do you want to use UISearchBar in the first place then? I'd go for either a custom view that draws something that looks like a UISearchBar, or, even simpler, just use a UIButton with an image that looks like a UISearchBar.
In case you really wanted to use the UISearchBar I guess you could subclass it and overwrite touchesBegan:, but I don't think this a good idea.

Focus and zoom in on a UITextField when touched?

How in the world does one get the iPhone view to zoom in on a focused UITextField? I need to tap on a text field that I want to edit, and my view should zoom in to the tapped text field and pull up the keyboard (which it already does), similar to how many Internet text fields gain focus on the iPhone. Is this some type of overlay?
I've been looking everywhere for this solution but maybe I've just got the wrong terminology. Thank you in advance.
Could be a duplicate of this StackOverflow question.
In essence, there are a number of ways, but you have to program this effect manually. A textfield is already an overlay. You can either move it, or scroll the containing view.
Please follow the following steps.
Implement the delegate method for all textfield.connect the outlet of textfield in interface builder basically it's setting the delegate property.then in delegate property you can defined the method whatever you want to implement or wanted to do functionality.
Thanks

UICatalog and Keyboard Events

The latest version of Apple's UICatalog example application includes zero code in the TextFieldController for handling keyboard show/hide events, and yet the table view still slides up and down beautifully with the keyboard.
Does anyone know what the new trick is? Are there settings in the XIB that allowed them to forgo registering for the notifications or using TextField delegate methods?
The TextViewController still uses keyboard notifications to deal with view sliding, so I'm really confused as to why this isn't included for TextFields anymore.
Thoughts?
You can close the keyboard, if it's open by calling:
[sender resignFirstResponder];
Not sure about opening the keyboard however.
The trick is hidden within calling becomeFirstResponder on a UITextField that is in a scrollable view. Apparently, whenever calling [textField becomeFirstResponder], iOS automatically scrolls the parent view until said textField is visible.
This behavior can actually be undesirable in some cases, as it will not usually scroll to the same location that the UIScrollView method scrollRectToVisible:animated: would if you were to try to do things that way.
Thanks for your thoughts everyone!

How to create a full-screen modal status display on iPhone?

I'm trying to create a modal status indicator display for an iPhone app, and would like one similar to this one used in Tweetie:
Specifically, this one "shades out" the entire screen, including the toolbar. I don't believe through any normal UIView manipulation, I can extend past the bounds of my window, can I? I believe I've seen a status indicator like this somewhere else on iPhone, possibly when I added an Exchange e-mail account.
I've tried subclassing UIAlertView and overriding its drawRect method. If I don't call [super drawRect:] it doesn't ever display the normal UIAlertView text box, however my drawing rectangle is in an odd size and position.
Anyone have any advice to accomplish this?
Check out MBProgressHUD.
Take a look at the source code to the WordPress application. They have code which you can basically drag and drop into your application to do this.
http://iphone.wordpress.org/development/
I haven't done this myself, but you could layer a UIView at the top of the view hierarchy, and use setHidden to dynamically show or hide it. Since it's at the top of the stack, it should be able to intercept all touch events.