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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:17:11+00:00 2026-06-17T21:17:11+00:00

I’m currently learning iOS Programming and I have a (hopefully) simple problem: I wrote

  • 0

I’m currently learning iOS Programming and I have a (hopefully) simple problem:
I wrote a drawing program that works with a customized class of UIView. That gets initialised upon startup in the main view controller in the viewDidLoad method

Image_DrawDraw *drawing = [[Image_DrawDraw alloc] initWithFrame:self.view.bounds];
[self.view addSubview:drawing];

I now want to change my program into a bit more sophisticated. I made a xib File containing some buttons, status bar and and image view. I still want to be able to draw in this new view, precisely over the image view, but not over the status bar or the buttons. But I have problems in initializing my Image_DrawDraw class it just overrides the whole xib and I’m back to my black screen where I can draw.
Thank you for your 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-06-17T21:17:12+00:00Added an answer on June 17, 2026 at 9:17 pm

    When you add a subView to a view hierarchy it becomes the last item in the superview’s views array property. The layering order of views is based on the views array, with the lowermost view the item at [views objectAtIndex:0] and the uppermost view the item at [views lastObject]. By arranging all of your other views on the Xib, and then adding your Image_DrawDraw view in code after the Xib has loaded, you are making it the uppermost view, so obscuring your buttons.

    Instead of adding it in code, you could place it directly in the Xib.

    Add a custom view to your xib. Position it above your existing xib image view, and below the buttons. Set the custom class of the view to Image_DrawDraw.

    Now you won’t need either of these lines of code:

    Image_DrawDraw *drawing = [[Image_DrawDraw alloc] initWithFrame:self.view.bounds];
    [self.view addSubview:drawing];
    

    To refer to you Image_DrawDraw xib view in code, you should make an IBOutlet property for it in your viewController’s @interface, and connect the Xib view to the IBOutlet by CTRL-dragging a line out in the Xib file.

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

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
this is what i have right now Drawing an RSS feed into the php,
I have a small JavaScript validation script that validates inputs based on Regex. I
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have been unable to fix a problem with Java Unicode and encoding. The
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am currently running into a problem where an element is coming back from
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function

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.