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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:52:49+00:00 2026-06-11T08:52:49+00:00

I am trying to change the background color and make an image appear on

  • 0

I am trying to change the background color and make an image appear on the screen when a button is pushed. I can get the color to change, but I can’t get a trace of the image to appear. I don’t know how to place the image on the screen either. I am using iOS 5 and storyboard, but I have not added the UIImageView to the storyboard, as I want it to appear.

My ViewController.h

#import <UIKit/UIKit.h>

@interface ViewController : UIViewController
- (IBAction)changeButton:(id)sender;

@end

My ViewController.m

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

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

}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(void)colorchange
{
   self.view.backgroundColor = [UIColor greenColor];
}

-(void)imageShow
{
    UIImage *image = [UIImage imageNamed:@"logo-tag-centered.pmg"];
    UIImageView *imgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];
    [imgView setImage:image];

}

- (IBAction)changeButton:(id)sender
{
    [self colorchange];
    [self imageShow];

}
@end

Any help would be greatly appreciated! Thanks!

  • 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-11T08:52:50+00:00Added an answer on June 11, 2026 at 8:52 am

    You have to add the image view to your view controller’s view.

    - (void)showImage
    {
        UIImage *image = [UIImage imageNamed:@"logo-tag-centered.png"];
        UIImageView *imgView = [[UIImageView alloc] initWithImage:image];
        imgView.center = CGPointMake(self.view.bounds.size.width / 2.0f, self.view.bounds.size.height / 2.0f);
        [self.view addSubview:imgView];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make the background color change on :hover but keep the background
I am trying to change the background image of a link when it get
I'm trying to make a web page where the background color of an image
I am trying to make a button with background image. <Button android:layout_width=wrap_content android:layout_height=wrap_content android:layout_marginLeft=5px
I am trying to get the background image of my content to appear behind
Im trying to change the background color of the ad to make it fit
I'm trying to make a div's background color change on mouse over . the
I am trying to change the Background Color of the ParentGrid when the child
Hey i am trying to change the background color of a div. I have
I am trying to change the menuOption background-color on hover using JQuery. All my

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.