I am getting data from server in my application. Currently I making this using NSUrlConnection and getting data in connectionDidFinishLoading. Mean while i am showing an alertView to user. but that time my view is not updated with data.
I can only show while whole response is came form server and refreshing the view later.
Can i restrict view to shown up only when whole response is acquired or can i make the that dark effect of uialertview more dark which make containing view disable???
EDIT:
From all answers i would like to know that can i make gray effect of UIAlertView more dark or may i change it with other color ? or can someone explain me how its shown up ??
1)In viewDidLoad method you can add another temporary view with dark gray background color.
2)Add activity indicator in this temporary view & start that indicator and set user interaction disable for self view.
3)In connectionDidFinishLoading stop the indicator & remove temporary view and enable user interaction of self view.
You can add a overlay of darker color and an UIActivityIndicator, make the userInteraction disabled for that period for time
Related
sap.ui.getCore().byId("oui5mvc.sdto").setVisible(false); //Not working
sap.ui.jsview("oui5mvc.sdto").setVisible(false); //Not Working
this.getView().byId("oui5mvc.sdto").setVisible(false); // Not Working
Is it possible to hide a view till I show busy indicator as it looks ugly in background to show containers with borders/labels/buttons till the data is populated. So I am trying to hide the view and once data comes I am setting it to true. But that do not seem to work. Is there any way I can do that or atleast if I can blur background till busy indicator is there.
In my app I am showing loading screen when request is sent to server and when response is received I am removing that loading screen.
To display loading screen I used UIView and reduce its alpha to 0.5 so that it shows the background view.
My problem is user is able to click button displayed on background view when loading screen is still visible.
What I want is: User should not be able to click anywhere on the screen when loading screen is visible. Even though I made userInteractionEnabled false for UIView but still user is able to click on button, why?
If any one knows where I am doing wrong and how I can achieve this, please let me know.
Thanks in advance!
The UIView may have interaction disabled but if the button is higher on the view hierarchy then its on TOP of the view so it's still accessible.
If this is a view made in the nib then make sure its at the top of the view stack
Or if its programmatically then add it as a subview at the end of the function or add it mainWindow (be VERY careful adding things to main Window, this is the top of the hierarchy)
Like wise the utility open source library available.
iOS open source project is MBProgressHUD,
it refers to Heads Up Display, a view that is overlayed on another view, typically to show an activity indicator and/or offer a means to interact with the UI. A good example of an HUD is when playing a movie with the built in movie player. When you tap the screen, the movie player will show a series of controls on the display. Another common example, and one that is pertinent to MBProgressHUD, is showing progress indicators on top of an existing view. For example, when accessing a remote service, to provide feedback to the user you may opt to display a “Please Wait” message
you can download the source code from here.
Yes I got it, I did userInteractionEnabled false for UIView so the click event was sent to the button which was on main view.I removed userInteractionEnabled false and it is working fine.
You can use [[UIApplication sharedApplication] beginIgnoringInteractionEvents] when you are sending request to server & shows loading view.When you receives the response call [[UIApplication sharedApplication] endIgnoringInteractionEvents] & remove the loading view.
I am working on an app which displays user information on the home view. Its a regular tab bar application, which brings up the home view on load. I need to display something like,
Hello Joe,
Your current points are : xxx
I would like this to be in a white curved background box. (The background for the view is blue). Is there something like a UIPanel or something like that. I would really like to avoid having another view or a webView, not sure if thats going to affect the speed of loading the page.
If there were a UIPanel control it would derive from UIView, so I'm not sure why you want to avoid another view. If I'm understanding you, it sounds like you want a custom alert window of some sort. You could just use the UIAlertView control to display your message, but if you are dead set on a custom look, then you will need to use a view.
This shouldn't affect performance noticeably if you are just displaying some text with maybe a button on a custom image. Especially if this is just a tab bar application with nothing too crazy happening in the background (animations, etc.).
I would suggest creating a View either in code (this will be slightly faster, but once again probably not noticeably so) or with Interface Builder that has a black background with an opacity of like .2-.5 and on that view adding a UIImageView set to your custom image (a png of a white curved box with transparent corners). Then put a UILabel with your text and a button to dismiss it.
On load just instantiate the above view and add it to your current view. It will show your message modally. Then capture the button tap event to have it remove itself from it's superview.
There are plenty of examples of how to do exactly this out there and there are even other ways of doing it than what I've suggested. If you need further assistance let me know.
Im using NSThead and have a loading screen whilst im downloading images form the web to display, whist this is happening, could i stop the UI touch being registered? I have buttons on that view and when the loading screen is up, its basicllya text label which has a slightly transparent background. but if someone clicks on it, it registers the back ground buttons being clicked so i want to avoid that.
I recommend to use a UIAlertView for this.
Override the buttons and provide your own "HideIt" handler wich finally call Dismiss...
UIAlterView is somehow a UIView so you can change it's look.
And it blocks the underlying UI without any extra code.
Also possible - Create a (somehow transparent) UIView which covers your View.
You can place a text and / or a UIActivity... on it to show a loading animation.
When loading starts show this thing - when done hide id.
If you want to update this view (Progress indicator / text) be sure to run the updates on the MainThread.
Manfred
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.