Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9215239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:09:37+00:00 2026-06-18T02:09:37+00:00

In my application I am reveiving data from a server. With this data I

  • 0

In my application I am reveiving data from a server. With this data I fill a table view (MasterViewController) and when I select one of the items in this table it is displayed with detail information in the DetailViewController. These information is loaded on every startup of the application or when the user presses a refresh button.

While receiving data from the server I want do display a view that contains a UIActivityIndicatorView and a label that says “Loading…”. This works just fine when my application is started or refreshed in portrait mode. But when I try the same in landscape mode the size of my view is incorrect.

Here is the code I am using to load my view:

+ (SpinnerView *)loadSpinnerViewIntoView:(UIView *)superView {

    SpinnerView *spinnerView = [[SpinnerView alloc] initWithFrame:superView.bounds];

    if (!spinnerView)
        return nil;

    UIImageView *background = [[UIImageView alloc] initWithImage:[spinnerView addBackground]];
    background.alpha = 0.7;
    [spinnerView addSubview:background];

    UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
    indicator.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleLeftMargin;
    indicator.center = superView.center;
    [spinnerView addSubview:indicator];
    [indicator startAnimating];   

    CGSize maximumLabelSize = CGSizeMake(296, 9999);
    CGSize expectedLabelSize = [[NSString stringWithString:@"Loading..."] sizeWithFont:[UIFont boldSystemFontOfSize:25.0f] constrainedToSize:maximumLabelSize];

    UILabel *loadingLbl = [[UILabel alloc] initWithFrame:CGRectMake(0.0, 0.0, expectedLabelSize.width, expectedLabelSize.height)];
    loadingLbl.text = @"Loading...";
    loadingLbl.font = [UIFont boldSystemFontOfSize:25.0f];
    loadingLbl.autoresizingMask = UIViewAutoresizingFlexibleWidth;
    loadingLbl.backgroundColor = [UIColor clearColor];
    loadingLbl.textColor = [UIColor whiteColor];
    loadingLbl.center = CGPointMake(superView.center.x, superView.center.y - indicator.frame.size.height - 25);
    [spinnerView addSubview:loadingLbl];   

    [superView addSubview:spinnerView];

    CATransition *animation = [CATransition animation];
    [animation setType:kCATransitionFade];
    [[superView layer] addAnimation:animation forKey:@"layerAnimation"];

    return spinnerView;
}

This is called from my MasterViewController when I start updating my data:

spinner = [SpinnerView loadSpinnerViewIntoView:self.splitViewController.view];

The SpinnerView gets the same bounds as the view in that it is loaded. I don’t really understand why it doesn’t display properly in landscape mode.
I hope my issue is understandable and anyone can help me.

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T02:09:38+00:00Added an answer on June 18, 2026 at 2:09 am

    I finally did it by changing the SinnerView call to:

    + (SpinnerView *)loadSpinnerViewIntoView:(UIView *)superView withFrame:(CGRect)frame {
    
        SpinnerView *spinnerView = [[SpinnerView alloc] initWithFrame:frame];
    
        if (!spinnerView)
            return nil;
    
        .
        .
        .        
    
        return spinnerView;
    }
    

    and calling a function from my viewDidLoad method like this:

    [self performSelectorOnMainThread:@selector(checkLaunchOrientation:) withObject:nil waitUntilDone:NO];
    

    Here’s the function:

    - (void)checkLaunchOrientation:(id)sender {
    
        UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
    
        if (UIInterfaceOrientationIsLandscape(orientation))
            spinner = [SpinnerView loadSpinnerViewIntoView:self.splitViewController.view withFrame:CGRectMake(0.0, 0.0, [UIScreen mainScreen].bounds.size.height, [UIScreen mainScreen].bounds.size.width)];
        else
            spinner = [SpinnerView loadSpinnerViewIntoView:self.splitViewController.view withFrame:self.splitViewController.view.bounds];
    }
    

    It’s kind of a workaround, but it works for me…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to receive data from a server application using boost asio's async_read()
My Application is recieving data from external hardware and plots it onto a panel
I have a server application receiving messages from a JMS queue. And client applications
I'm receiving suddenly this error on a Win2003 Server Web Application: Microsoft VBScript runtime
I followed the example given in this post: How to send data from Matlab
I want to execute a JavaScript application on the server as a service. This
I'm working on an application which communicates with server and receiving a data stream,which
I have an application which receives GPS data from a mobile device as well
I have an application which is receiving data for thousands (say 50,000) subjects. Each
I am sending and receiving data using fsockopen and fwrite. My application receives the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.