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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T10:24:20+00:00 2026-06-08T10:24:20+00:00

I have the following code in my XCode project for an iOS app I’m

  • 0

I have the following code in my XCode project for an iOS app I’m developing:

    testLabel = [[UILabel alloc] initWithFrame:CGRectMake(0,0, 320, 480)];
    UIFont *Font = [UIFont fontWithName:@"Arial" size:40];
    [testLabel setFont:Font];
    [testLabel setTextAlignment:UITextAlignmentCenter];
    [testLabel setTextColor:[UIColor colorWithRed:(float) 55/255 green:(float) 41/255 blue:(float) 133/255 alpha:1.0]];
    testLabel.text = @"Here We Go";

I am looking to put an image in that spot instead of the text. What do I need to replace this code with?

  • 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-08T10:24:22+00:00Added an answer on June 8, 2026 at 10:24 am

    Either you make an image and put it in an UIImageView or you make a UIView subclass in which you will draw the text inside the drawRect method.
    In the second case, in your drawRect you do this :

    [self.yourStringProperty drawAtPoint:CGPointMake(100,150) withFont:[UIFont systemFontOfSize:14.0]]; 
    or
    [self.yourStringProperty drawInRect:rect withFont:[UIFont systemFontOfSize:14.0]]; 
    

    Also, look HERE for a detailed explanation of these functions which can also take into account the available width, minimum sizes, line breaks, etc.

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

Sidebar

Related Questions

I have the following warning in my code (XCode 4.3 / iOS 4/5) -
I have an xcode project that's with the following code: in fflayer.h int *ffinjar;
I have following code that I am compiling in a .NET 4.0 project namespace
I am developing an app for iOS 5, which have to run in landscape
I am learning to write an iOS-native webkit app. In Xcode 3.x, I have
I have the following in a simple C++ console project in Xcode. When I
I've got an XCode iPHone project setup with the following: My App Delegate creates
I just created an Xcode project and wrote the following code: #define foo(x) x
I have created a new project in Xcode and performed the following to add
I have following code in initialization im = imread('Image02.tif'); figure(); imagesc(im); colormap(gray); [hImage hfig

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.