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

  • Home
  • SEARCH
  • 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 6058871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:38:51+00:00 2026-05-23T08:38:51+00:00

// Create and add a sub view CGRect viewRect = CGRectMake(0, 0, 200, 200);

  • 0
// Create and add a sub view
CGRect viewRect = CGRectMake(0, 0, 200, 200);
UIView *a_sub_view = [[UIView alloc] initWithFrame : viewRect];

[window addSubview : a_sub_view];

After adding the above 3 lines of code, xcode produces no errors or warnings. But the sub-view is not showing at all. The sample program seems to be running exactly as before. Hope that somebody knowledgable could 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-23T08:38:52+00:00Added an answer on May 23, 2026 at 8:38 am

    I find it useful to set the background color so I know where the view is and the boundaries.

    a_sub_view.backgroundColor = [UIColor redColor];
    

    In your example, you’re create an empty view so you won’t ‘see’ anything.

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

Sidebar

Related Questions

Below is my code: SecondView *sview=[[SecondView alloc] init]; [self.view addSubview:[sview view]]; sview.view.layer.cornerRadius=20; CGRect rect=sview.view.frame;
I create an UIView in applicationDidFinishLaunchingWithOptions method: CGRect inputTextViewRect = CGRectMake(0, 420, 320, 80);
I want to create a tableviewcell and add it on the view(not tableview) as
I've create a subview using following code: -(void) viewDidLoad { CGRect subviewRect = CGRectMake(0,
If I create a UIControl at runtime and add it to a view (via
I want to create an add-in for Word to convert between Vietnamese character sets
I'm trying to create a simple Add-On for SQL Server 2008; it is simply
There are some updates with .NET 3.0 concerning how to create and use add-ins
I create dynamic LinkButton and I add LinkButton's Click Trigger to UpdatePanel. Now, When
When I dynamically create a Datagrid and add in a new buttoncolumn how do

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.