I am implementing something like Eula in my iPhone app. I need to enable the confirm button only when user reads whole Eula (scrolls along whole long text).
I am using UIAlertView, with long inside text. Thanks to this, the text field inside alert view have a scroll bar on its right side.
I need to access the delegate of this scroll, because I need to enable OK button only if user scrolls down with scrollable text.
If you are planning to release this app on the AppStore, you can't do it using the builtin UIAlertView.
UIAlertView doesn't have any method, and it's delegate protocol doesn't give you this kind of information.
Probably you can achieve this iterating through the subviews of the UIAlertView instance, but doing this will guarantee your app the rejection :-)
the only thing you can do is to create your own "MYAlertView" component
Related
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.
I am trying to use a UIAlertView essentially as a label (no title or buttons, just display text) for aesthetic purposes. I want to be able to continue to use everything else in the app (touch other buttons, etc.) while the alert view is being shown. Unfortunately, I cannot seem to invoke touchesBegan or a selector using a UITapGestureRecognizer while the alert view is shown. These both work when the alert view is not shown, but it seems like the alert view disables detection of any touches (other than touching its own buttons if it had them).
Does anyone know a way I could work around this? Even if I was to create a UILabel and set its background to the alert view image that would work.
Thanks for your help.
The alert view puts a new window on top of the entire screen which intercepts touches. It's expressly designed to prevent you from doing what you're trying to do. Why are you trying to abuse alerts in this manner anyway? It's generally a bad idea to take existing UI and use them in non-standard ways, as well as a possible reason to get rejected.
Your best bet is to just draw the "alert view" yourself, either in code or as a pre-baked image. Unfortunately this means you cannot leverage the built-in code that draws UIAlertView, but it's probably best that you don't try to appear identical to a UIAlertView anyway.
I want to display a view with two text field and a button. I want to pop the view like an alert view. Just like how Facebook is popping up and asking for credentials.
The UIAlertView will accept addTextFieldWithValue:label:, but this is an undocumented API and may cause Apple to reject your app. There was a discussion in the iPhoneDevSDK.com forums about this with some sample code to do the same in an acceptable manner.
http://www.iphonedevsdk.com/forum/iphone-sdk-development/1704-uitextfield-inside-uialertview.html
The way to do this is to subclass UIAlertView and override the DrawRect: method. You can then resize the window, change its color, and anything inside. Hope it works out for you!
Edit: here is a link that i used a while back to give me a basic idea behind it.
http://joris.kluivers.nl/iphone-dev/?p=CustomAlert
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.
I have a case where i pull information from a server. My application has both a tab bar and navigation buttons. I want the application to show a progress indicator and disable all other controls so that user can't jump around while the data is being pulled from the server. How can i achieve this?
One approach i have in mind is to show a transparent view with a progress window (much like the message alert window - which allows the user to interact with the message alert window only). I need help in implementing this approach.
Currently, when the information/data is being pulled from the server i add a UIActivityView to the subview and start animating it. But this does not restrict the user from navigating to other parts of the application.
Stephan suggested the use of UIAlertView with UIProgressView or UIActivityIndicatorView. This solution worked for me, but as discussed with some of the other members of iPhone developer community, this approach is not recommended.
The recommended approach is to use a new view and set its transparancy value to alpha 7 or 8, set it's background to black, and add UIProgressView or UIActivityIndicatorView in this view and use this new view to show progress. No hack is involved in using this technique. While, incase of adding UIActivityIndicatorView to a UIAlertView, your actually performing a non-documented operation (which is not recommended).
Thanks.
Just create an UIAlertView with no buttons, it will prevent any user interaction.
You can add an UIProgressView or UIActivityIndicatorView to your alert if you want.