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 6708419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:45:26+00:00 2026-05-26T07:45:26+00:00

I am using the following code to for Creating UILabel s and calling it

  • 0

I am using the following code to for Creating UILabels and calling it by paramater passing. I am using UIViewAutoSizingMask for autosize of labels when rotated in different orientation.

[self.view addSubview:[self createLabel:CGRectMake(450,240,60,20):@"Ratings:"]];  
[self.view addSubview:[self createLabel:CGRectMake(450,270,60,20):@"Reviews:"]]; 

[self.view addSubview:[self Label:CGRectMake(505,240,60,20):aRequests.ratings]];  
[self.view addSubview:[self Label:CGRectMake(510,270,60,20):aRequests.reviews]];`
self.view1.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin |UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;

-(UILabel*)createLabel:(CGRect)frame :(NSString*)labelTitle
{

    UILabel *myLabel = [[UILabel alloc] initWithFrame:frame]; 
    [UIFont fontWithName:@"Arial" size:13];  
    myLabel.textAlignment = UITextAlignmentLeft;    
    myLabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleWidth;
    myLabel.text = labelTitle;     
    [myLabel autorelease];
    return myLabel;
}

In Portrait view it displays like this,

                   Ratings:3
                   Reviews:4

whereas, When rotated to landscape it display like this.

     Ratings:   3
     Reviews:    4

There is a space provided after “Ratings” Label. I have used all Autoresizing mask still its not working.

can anyone suggest anyone what is happening and what changes should be done in the above code.I tried all the autoresizeingMask everything but still i am not able to fix this.

  • 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-05-26T07:45:27+00:00Added an answer on May 26, 2026 at 7:45 am

    The masks are conflicting eachother, use:

    self.view1.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleHeight;
    

    and

    myLabel.autoresizingMask =  UIViewAutoresizingFlexibleRightMargin;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a color object using the following code. curView.backgroundColor = [[UIColor alloc] initWithHue:229
I am creating several image dynamically using the following code: function refresh_gallery(galleryidentifier, albumid) {
I'm creating a thumbnail for an image using the following code: im = Image.open('original.jpg')
We're creating a FileInfo object in C# using the following code: if (planConfig->OrganisationsFilePath !=
I am creating HTML using following code : NSString *string = [NSString stringWithFormat: @<html>
I am creating forms authentication cookies using the following code: string formsCookieStr = string.Empty;
I am creating a window using the following code: if(hudWindow == nil) hudWindow =
I am very new with Java. I am using following code for the calling
I am creating a PHP session using the following code: <?php session_start(); $_SESSION['loggedin'] =
i am creating the search bar and table view programatically using the following code

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.