In an app I'm working on we have some legacy code that displays timed UIAlertViews at several points in the application. These are alert views that display for a certain amount of time (let's say 2 seconds) before they disappear.
These alert views don't have buttons, just a title and a message. Somehow these alert views worked just fine on iOS 5, 6 and 7, but on iOS 8 the message label isn't being displayed anymore.
Does anyone have a fix for this issue? I should note we're not interested in using UIAlertController, since that class is limited to iOS 8 and we need to support older versions as well.
So my question is as follows: is it possible on iOS 8 to display an UIAlertView with just a title and a message and NO buttons? (PLEASE NOTE: the message should be shown properly).
For anyone still struggling with this issue, I used the following approach:
I created an AlertController class that decided which version of an alert view to use. For iOS 7 and lower will default to the "build-in" UIAlertView. For iOS 8 I resorted to a custom alert view.
There are several custom alert views that could be used to create a modal dialog that displays for a few seconds. I based my custom alert view on the code from the iOS Custom Alert View project. Additionally I fixed the look and feel. Suffice to say, the default look and feel of this project doesn't closely match the iOS 7 / 8 look and feel, especially with regards to the buttons. The pop / hide animation is pretty well done though. Fixing the look and feel involved creating a custom dialog view class that uses -drawRect: to draw lines around buttons. The custom subview will also add it's own buttons.
An alternative project that might have a better look and feel out-of-the-box is SDCAlertView. If I would have found SDCAlertView before starting my work on fixing iOS Custom AlertView, I would probably have saved some time.
I should note I cannot share my code / changes. My employer would not like this at all.
You can try this code for your UIAlert:
let alert = UIAlertView()
alert.title = "Title"
alert.message = "Message"
alert.show()
It should display a UIAlert without a button.
Hope this can help you.
Related
Currently,I am developing one app in which i set simple alert on one button click.
All operation performed very well on all device but when i run my app on iPhone 4 alert's height automatically increase and my subview's which add in alert its layout is not looking good.
What is issue is generating i cant find out please suggest me some solution.
I need to implement iOS 7 like download button to show progress (Same as it is in iOS 7 AppStore app downloads).
Anybody has any idea what is the way to go about it?
Is there any existing control to achieve this or it is something apple specific and anybody else needs to implement using custom CAShapeLayer etc?
You have to make your custom implementation.
If you need it, here it is a very similar one:
An iOS 7-inspired blue circular progress view
Check my library, it contains that button, and it is customizable https://github.com/PavelKatunin
I know that this is an old question, asking for iOS 7 App Store download button, but if anyone is looking for the download button of the latest App Store (since iOS 11) I can suggest you take a look at this library. It provides the download button with progress and transition animation.
Here is a demo.
I'm building an App for Android, iOS and Blackberry with Sencha Touch 2.0.1.
I have a Form-Panel with about 10 selectfields and some sextfields. If i ran the app on Android 2.3 or higher, the selectfields are shown as pickers. So far so good.
When the user starts filling out the form starting with textfields, he can go through the form using the next-button on the virtual keyboard. The problem is, that the selectfields are ignored by the next-button. The user has to tap on the selectfields.
I can't figure out how to get prev- and next-Buttons for the picker-elements. So that I can go through the form only with the next-Button instead of pressing "done" and tapping on the next Selectfield. It would be far more comfortable for the user.
So support of the sencha-forum isn't really helpful, see below:
http://www.sencha.com/forum/showthread.php?219636-Native-select-field-for-Android
http://www.sencha.com/forum/showthread.php?205581-Can-I-use-iOS-native-picker-instead-of-ST2-picker
According to this, there are prev- and next buttons available for a picker:
http://www.sencha.com/forum/showthread.php?205159-Ext.picker.Date-with-no-prev-and-next-buttons&p=803794
But I can't find them:-(
I think, there are two solutions to the problem:
Accessing the native Picker as proposed in the first link above. The question is how?
Implementing an own Picker-Element with an Prev- and Next-Button. This seems to be a huge efford for such a basic task.
I can't really believe, that this is such a big deal in a big framework like Sencha Touch.
Anyone facing the same problem and has a working solution?
My only idea for you would to put your picker on the page as normal, then add two buttons on the page - a Prev and Next buttons using Sencha. Then add onTop handlers for those buttons, that use the picker's .setActiveItem() method to set the picker to the next or previous item. Hopefully that will get you on your way.
http://docs.sencha.com/touch/2-0/#!/api/Ext.picker.Picker-method-setActiveItem
I am designing an iPad app in which I have a textView apart from other things. In that textView I am currently rendering wikitext. I have implemented basic functionalities like bold, italic etc. in the editor using accessory view.
Now, I want to provide the user an another mode to edit in rich text as well. The rich text editing will be done in the web View (not implemented yet). The problem I am facing is that I don't know a way to keep the text in both the modes in sync so that when a user jumps from one to another he is able to see the changes made in the other mode instantly.
Can someone suggest some clue regarding this? Thanks.
It's no problem to sync from the UITextView to the UIWebView using UITextViewDelegate to fire events as soon as the User types into the TextView. The bigger problem is the UIWebView you'd need to check its source-code to check changes and then sync them to the UITextView.
The next best possibility would be to wait on iOS 6 which provides styled text, but iOS 6 is still under NDA, so nobody will provide you help.
I thought that it was not allowed to customize the taskbar on the iPhone. However, I noticed this app called iHandy Tip Calculator which replaces the battery icon with a fast switch icon, that pops up a view as shown. How is this allowed, and if so how can I be doing something different?
If you run the app on an iPad, you'll see, how they do it: they are overlaying the normal status bar. Also note, that the screenshots in the app store don't show this feature. I assume, they were fearing to get rejected and disabled the overlay for the screenshots.
Apps from this developer iHandy incorporate this into the status bar, but I've never seen another company do this. I am surprised that the status bar is able to be modified in this way in any event.
My question on apple.stackexchange is posted over here:
https://apple.stackexchange.com/questions/71969/what-is-the-meaning-of-this-status-bar-icon
It is possible to create your own statusbar and "simulate" the network status and battery life etc in a 'full-screen' app. But apple doesn't allow it, but this might be one that 'slipped through' just like Gaz_Edge said.
You are correct. You are not suppose to be able to modify the 'springboard'. Apple normally refuse apps that do anything that modifies it. Maybe this one slipped through the net?
I just downloaded the latest version of iHandy Level (version 1.62.0) on an iPhone 5 running iOS 6 but don't see the icon (it's within the app rather than in the status bar). (And the status bar is hidden.)
I was curious to see if they actually hid the status bar and created their own custom status bar. If that was the case, you'd be able to tell because when you swipe down from the top for notification center, it would first show a little tab and then you'd have to swipe again to pull down the menu.
Guessing maybe they removed this functionality at Apple's request.
If anyone still has a version that shows it, please let us know if it shows the tab when you swipe for notification center. If not, they likely found some private api to allow them to replace the battery icon (which would be interesting).