?
Solved

How do I set the background image using UIImage

Posted on 2012-09-01
9
Medium Priority
?
511 Views
Last Modified: 2012-10-18
I have been trying to set the background image with imagenamed but just couldn't get it to show, please help and show me the code.
0
Comment
Question by:charmingduck
  • 5
  • 4
9 Comments
 

Author Comment

by:charmingduck
ID: 38357062
I don't think they have a solution there
0
 
LVL 15

Expert Comment

by:Hamidreza Vakilian
ID: 38357075
What you want to set background image for? A uiview?
0
How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

 

Author Comment

by:charmingduck
ID: 38357081
yes, say I want to set a background image for a form
0
 
LVL 15

Accepted Solution

by:
Hamidreza Vakilian earned 840 total points
ID: 38357092
self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"imageName.png"]];

Open in new window


you should have added your png file into your project. (e.g. drag & drop on left panel in xcode)
0
 
LVL 15

Expert Comment

by:Hamidreza Vakilian
ID: 38357094
if you did not make it check this tutorial which also has an example project:
http://www.roseindia.net/tutorial/iphone/examples/uiviewimagebackground.html
0
 

Author Comment

by:charmingduck
ID: 38357096
I got property view could not be found
0
 

Author Comment

by:charmingduck
ID: 38357098
I got it working by replacing view with window, are they two different things?
0
 
LVL 15

Expert Comment

by:Hamidreza Vakilian
ID: 38357112
thats probably bacause you are running the line on appdelegate.m; try running the line on viewDidLoad method of the corresponding viewcontroller.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently went through the process of creating an installable image of an iPhone mobile app (an .ipa file) that beta testers could load onto their test devices. The process involved quite a few steps, but both Appcelerator and Diawi.org had decent …
How to take pictures with depth using iOS 10
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question