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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:30:19+00:00 2026-06-14T00:30:19+00:00

I have an iPhone game that I’m trying to create for school, yet I’m

  • 0

I have an iPhone game that I’m trying to create for school, yet I’m having some trouble. I’ve created an animated UIImage that I’m using as my background. The problem is, that’s the farthest that I’ve got. I can’t display any buttons, text, or labels above the ImageView. I have it set in the View controller to where the ImageView is at the bottom so that all of the other objects can appear above. Does anyone have any idea what I’m doing wrong here or what I could add that could possibly fix this? I’ve included the code that creates the animation.

    - (void)viewDidLoad

{
// create the view that will execute our animation
UIImageView* YourImageView = [[UIImageView alloc] initWithFrame:self.view.frame];

// load all the frames of our animation
YourImageView.animationImages = [NSArray arrayWithObjects:    
                                 [UIImage imageNamed:@"Star-Field 1.png"],
                                 [UIImage imageNamed:@"Star-Field 2.png"],
                                 [UIImage imageNamed:@"Star-Field 3.png"],
                                 [UIImage imageNamed:@"Star-Field 4.png"],
                                 [UIImage imageNamed:@"Star-Field 5.png"],
                                 [UIImage imageNamed:@"Star-Field 6.png"],
                                 [UIImage imageNamed:@"Star-Field 7.png"],
                                 [UIImage imageNamed:@"Star-Field 8.png"],
                                 [UIImage imageNamed:@"Star-Field 9.png"],
                                 [UIImage imageNamed:@"Star-Field 10.png"],
                                 [UIImage imageNamed:@"Star-Field 11.png"],
                                 [UIImage imageNamed:@"Star-Field 12.png"],
                                 [UIImage imageNamed:@"Star-Field 13.png"],
                                 [UIImage imageNamed:@"Star-Field 14.png"],
                                 [UIImage imageNamed:@"Star-Field 15.png"],
                                 [UIImage imageNamed:@"Star-Field 16.png"],
                                 [UIImage imageNamed:@"Star-Field 17.png"], 
                                 [UIImage imageNamed:@"Star-Field 18.png"], nil];

// all frames will execute in 1.75 seconds
YourImageView.animationDuration = 0.5;
// repeat the animation forever
YourImageView.animationRepeatCount = 0;
// start animating
[YourImageView startAnimating];
// add the animation view to the main window 
[self.view addSubview:YourImageView];

[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.

}

  • 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-14T00:30:21+00:00Added an answer on June 14, 2026 at 12:30 am

    When instantiating view controllers, the views in the XIB file get instantiated first. After this, the viewDidLoad method gets called.

    You are instantiating a new image view in your viewDidLoad, this image view is added on top of every subview, which is why your buttons, labels, etc do not show up.

    To fix this, you can instruct the view controller’s view to send the new image view to the back, like this:

    [self.view addSubview:YourImageView];
    [self.view sendSubviewToBack:YourImageView];
    

    If I understand your description correctly, you have placed an image view to serve as your background in your XIB as well. You can access this instead of creating a new image view in the viewDidLoad method. To do this, you have to declare an IBOutlet property for the image view in your XIB file.

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

Sidebar

Related Questions

I am building an iphone game. I have a set of NSStrings that I
I have an iPhone game that dispenses in-game currency over time, and someone discovered
Please forgive the newbie question. I have an iphone game that currently uses lots
I'm building an iPhone game and I have a UIBarButtonItem that will provide the
I have a sprite in my iPhone game, how can make it so that
I am working on an iPhone game that maintains a leaderboard and some social
I'm facing a weird problem in cocos2d for my iPhone game. I have created
I have a simple leader boards table for an iphone game that allows me
i have developed a game that is currently running on iphone/ipad/ipod touch without any
I have a background file that I wish to use in an iphone game

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.