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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:32:50+00:00 2026-05-14T02:32:50+00:00

I was looking up how to create a view programmatically and found the following

  • 0

I was looking up how to create a view programmatically and found the following example code:

self.view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];

This works great, except I don’t like that it hardcodes the size of the screen. Is there a way to look up the size of the screen? An important point someone brought up is that if the app is running during a phone call then the screen will be slightly smaller because of the green “return to call” bar.

  • 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-14T02:32:50+00:00Added an answer on May 14, 2026 at 2:32 am

    Is there a way to look up the size of
    the screen?

    Yup:

    CGRect screenRect = [[UIScreen mainScreen] applicationFrame];
    

    applicationFrame

    This property
    contains the screen bounds minus the
    area occupied by the status bar, if it
    is visible. Using this property is the
    recommended way to retrieve your
    application’s initial window size. The
    rectangle is specified in points.

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

Sidebar

Related Questions

I created a Materialized view using the following code: CREATE MATERIALIZED VIEW M_USER_HIERARCHY BUILD
I'm looking to create a 'drop down' view that falls in front of the
I'm looking to create a nice way to separate view and controller in php.
Lets say we have the following: create view view_1 as ( select key, data
I've got a list view in my content area. Looking to create a overlay
I'm looking to create a view of a table which will highlight data that
Here is the example I'm looking to create... Let's assume there are two divs,
I am looking to create a list view which contains a image and 2
As the title says: in sharepoint 2010 i need to programmatically create a view
I looking to create a custom calender with Zend Framework, I am hoping that

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.