I have used UIAlertview in the iPhone application that is customized a little bit.I have added three buttons in the UIAlertview and some text in between two buttons.
Please let me know if apple have any concerns if UIALertView is customized with text in between two buttons.
UIAlerView screen is as described below,
Title Alert Message
First Button
Second Button
(Text message)
Cancel Button
I cant attach image here as i need to get more than 10 reputation points here.
Thanks in advance.
In my experience I've had no issues with modifying UIAlertViews in any way. I don't think Apple will care.
Related
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
I am needing to alert something for an answer for a trivia game iOS app I am writing. I have an alert view that pops up and shows a scrollable uitextview...is Apple going to ding me for that? What are my options for showing large amounts of text in my alert?
Thanks!!
I think that showing UITextView is ok. Moreover it seems that Apple actually does the same thing - if you try to display very long text in UIAlertView then it will be displayed in scrollable UITextView automatically
P.S. and it also uses UITableView instead of buttons if you set too many button names.
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
Anyone have code to make this:
(source: booleanmagic.com)
or better yet, a 3x2 grid of buttons with images using the UIAlertView object?
I don't care about the textfield, it's the buttons in a grid I want (preferably with images rather than text).
I think your best bet is to forget customizing UIAlert view and build a custom view yourself.
For one, what you're showing really isn't an "alert" so it's counter to what UIAlertView is designed to be for. This means that you're changing the UI paradigm on the user which is never a good idea.
Second, it would be much easier to animate a custom view into place than to try and hack UIAlertView to get it to do what you want.
First you need to make the alert box bigger to accomodate your controls, yet it has to be placed at the center.
For this, instead of setting the frame size, your the message text with "\n"s as necc. e.g.:
alert = [[UIAlertView alloc] initWithTitle:#"Rate this picture."
message:#"Tap a star to rate.\n\n\n\n " /*------ look at here!!----*/
delegate:self
cancelButtonTitle:nil
otherButtonTitles:nil];
Then use a UIAlertViewDelegate for the alertview.
override its, viewWillAppear:
add your buttons and set their frames manually at desired position.
OR:
create a entire view with a view controller, and add the view to the alert box like:
[myalertview addSubvew:mycomplexalert];
Hope this will come into your help :)
I am using alert boxes for rating input with star images,twitter,fb feedback etc.
UPDATE iOS7:
For iOS 7, create your own view with components and set it as the alertview's accessory view:
[alert setValue:imageView forKey:#"accessoryView"];
Its thats simple :-)
This tutorial covers how to subclass UIAlertView to achieve an input text box. It explains how to enlargen the view, add subviews (like text boxes or images) and make a transform to move the box up higher on the screen.
I wrote a almost pixel perfect UIAlertView replacement, that's also fully configurable. Have a look at CODialog if it fits your needs.
There are no in-built components for this. UIAlertView should just have text and buttons as per the HIG document.
You will have to create your own view and add controls to it. The HeadsUpUI example in the SDK shows how to show a custom menu-like view as an overlay.
Hope that helps.
I've seen a number of blogs claim that UIAlertView from firmware 3.0 onwards will show a table view if too many buttons are added to it to fit in the alert box. However, I don't seem to find this the case, either in the simulator or on the device. Before I look at using one of the mechanisms for manually adding a tableview to an alert, I want to make sure I'm not replicating something the OS already does.
No, the thing that shows a table view is UIActionSheet when it has too many items. It's really ugly.
I've never heard of this behavior until you asked, and I've never observed it. Reading the entire UIAlertView documentation leads me to believe that this is not the case.
It sounds like you already tried adding a bunch of buttons to the UIAlertView and weren't able to replicate the behavior, so I'd call this one busted.
Yes, if you add too many buttons into UIAlertView, it will show them as tableView.
More than that, any amount of buttons you see in UIAlertView are part of integrated UITableView. So any time you click the button in the alert, you actually call didSelectRowAtIndexPath: of UITableView.