views:

27

answers:

1

Hi friends,

I have created scroll view and set the buttons in the scroll view. The buttons are scrolling horizontally. I created table view as subview for view controller. On clicking the buttons, the datas are displaying in the table view from RSS feeds using XML Parsing. SO changing the datas in the table view which depends the button clicking. When i changed to select the next button, the parsing will be started and displayed the datas. so it takes some times. In the mean time i want to display some view or disable the view(that means,on that parsing time the view is disable or user cant do anything like freeze with activity indicator). On changing the each buttons, the action will be happened. I referred some tutorials, but i cant get any idea? Some people told me to use synchronous method to solved the problem. But i don't have any idea about it. Please guide me and help me out.Give me some sample apps and Links.

see my below image,

Image

Thanks in Advance!

Regards,
Pugal

A: 

Don't use synchronous network calls to disable user input. Whoever suggested that gave you very bad advice.

If you just want to disable input for your current view and its subviews, you can do self.view.userInteractionEnabled = NO; in your view controller.

If you want to disable input for the entire window, you can do self.view.window.userInteractionEnabled = NO;

You won't need to disable user interaction at all if you overlay a full-screen view on top of your user interface. Based on your mock-up image, I think this is what you're trying to do. To do this, you can do something like this:

self.overlayView = [[[UIView alloc] initWithFrame:self.view.window.bounds] autorelease];
self.overlayView.backgroundColor = [UIColor blackColor];
self.overlayView.alpha = 0.5f;
[self.view.window addSubview:self.overlayView];
self.activityIndicator = [[[UIActivityIndicator alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite] autorelease];
self.activityIndicator.center = self.view.window.center;
[self.view.window addSubview:self.activityIndicator];
[self.activityIndicator startAnimating];
self.activityLabel = [[[UILabel alloc] initWithFrame:CGRectZero] autorelease];
self.activityLabel.text = @"Loading...";
[self.activityLabel sizeToFit];
self.activityLabel.center = CGPointMake(self.activityIndicator.center.x, self.activityIndicator.center.y - self.activityIndicator.frame.size.height);
[self.view.window addSubview:self.activityLabel];
cduhn
Thanks for your detailed answer. I want exact this. Thanks a lot.
Pugal Devan