[TIMOB-10780] iOS: Activity Indicator for AlertDialog
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Medium |
Status | Closed |
Resolution | Won't Fix |
Resolution Date | 2014-02-24T22:24:57.000+0000 |
Affected Version/s | Release 3.0.0 |
Fix Version/s | 2014 Sprint 04, 2014 Sprint 04 API |
Components | iOS |
Labels | api, supportTeam |
Reporter | Hidayet Dogan |
Assignee | Ingo Muschenetz |
Created | 2012-08-16T02:29:14.000+0000 |
Updated | 2017-03-29T17:47:35.000+0000 |
Description
It would be nice to have an option to show activity indicator on AlertDialog view.
For example:
!http://mobiledevelopertips.com/wp-content/uploads/2010/02/alert3-204x300.png!
AlertDialog can be "showIndicator" option or something like that.
var dialog = Ti.UI.createAlertDialog({
title: 'Loading...',
message: 'Please wait, loading assets.',
showIndicator: true
});
I'm waiting PR found at https://github.com/appcelerator/titanium_mobile/pull/2789 for issue TIMOB-10507. I may use new "style" property instead of "showIndicator" property, if it's accepted and merged.
I've been able to do this by editing TiUIAlertDialogProxy.m on the Titanium SDK and adding the following code, just after {color:blue}[alert show]{color}.
Then I just set the property {color:blue}showIndicator{color} to {color:blue}true{color}. In order to remove the default button I set the property {color:blue}buttonNames{color} to an empty array {color:blue}[ ]{color}.
Please implement solution from Vasco Borges.
Please implement solution from Vasco Borges.
That implementation is currently crashes application. Tested on iOS 6 SDK with Titanium SDK 3. I'll try to fix implement if I find a spare time.
Works with Titanium SDK v2.x. Tested on iOS v4, v5, v6.
While Android allows customization of the Ti.UI.AlertDialog element via the androidView property, the options on iOS are pretty limited. iOS explicitly forbids subclassing the UIAlertView element or changing the view hierarchy, so the solution proposed above is a non starter. See https://developer.apple.com/library/ios/documentation/uikit/reference/UIAlertView_Class/UIAlertView/UIAlertView.html, https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/UIKitUICatalog/UIAlertView.html#//apple_ref/doc/uid/TP40012857-UIAlertView That being said, you can always fake the look and feel of a UIAlertView using regular Ti.UI.View with rounded borders on iOS. This of course would mean that the other UI elements on the screen would be inter-actable and it would not behave as a true alert view. To overcome this you could stick your custom view inside a transparent Ti.UI.Window on iOS and open this window. In this case you should be prepared for the blur and focus events of your top Ti.UI.Window when the window with the fake alert view is opened and closed. Either ways we will not be implementing this in our SDK as the workarounds can be implemented in JS.
Closing ticket as "Won't Fix", with reference to the above comments.