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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:42:13+00:00 2026-05-13T23:42:13+00:00

I have to show a label with font size = 14 when the view

  • 0

I have to show a label with font size = 14
when the view is 480×320.

Supposing I would like to do this in a way that my code will be working well for all future device’s screen sizes, including iPad and others following (I am sure more will come), what is the best way to do that?

I could do this proportionally, I mean, if the scale increased X, increase the fonts X, but my concern is the different aspect ratios of the devices.

The iPhone aspect ratio is 1.5, but iPad’s is 1.33, and other aspect ratios can come… I am not sure if this simple scale method will be enough to produce font consistency across all devices.

Any suggestions?

thanks for any help.

  • 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-13T23:42:14+00:00Added an answer on May 13, 2026 at 11:42 pm

    You could try to use this code. It will automatically scale your text down to fit within a certain width (here the contentRect). Just specify the minimum and maximum acceptable font size to use:

    #define MAX_FONT_SIZE
    #define MIN_FONT_SIZE
    #define LEFT_TEXT_OFFSET
    #define TEXT_TOP
    
    UIFont *theFont = [UIFont systemFontOfSize: MAX_FONT_SIZE];
    CGRect contentRect = self.bounds;
    CGFloat boundsX = contentRect.origin.x;
    CGPoint point;
    CGSize width = contentRect.size.width;
    
    point = CGPointMake(boundsX + LEFT_TEXT_OFFSET, TEXT_TOP);
    [theText drawAtPoint:point forWidth:width withFont:theFont 
             minFontSize:MIN_FONT_SIZE actualFontSize:NULL
             lineBreakMode:UILineBreakModeTailTruncate
             baselineAdjustment:UIBaselineAdjustmentAlignBaselines];
    

    Claus

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

Sidebar

Related Questions

I have some text in a UITextView, that I would like to have show
I have a Show table, and I would like to have a derived type
I have to show records in such a way that some selected records should
I have a site that will show the priority of a user made in
I have this little test-case which is supposed to show two widgets, with one
i need again your help... I have this php code: <? if(isset($_POST['addnews'])){ $type =
I have simple user control with include ajax control - CalendarExtender. This is code:
I have a form element, that is hidden or show depending on a dropdown
I have a grid view code below which have divided into 3 column .
I have an < mx:Label > tag that has a set width, which is

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.