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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:28:42+00:00 2026-05-26T14:28:42+00:00

I am experimenting with some new properties in iOS 5 regarding UIProgressView . They

  • 0

I am experimenting with some new properties in iOS 5 regarding UIProgressView. They are:

@property(nonatomic, retain) UIImage *progressImage;
@property(nonatomic, retain) UIImage *trackImage;

These new properties enable the customisation of the “progress” and the “track” image, so that you can make fancy progress bars without having to roll-your-own.

I however cannot understand how Apple “stretches” the progress images, because documentation is a little flakey / OR there is some standard I am not aware of. Regardless, I am asking if someone can help me understand how to make appropriate progress and tracking images.

I get results like this when I load my custom images, no matter which sizes I try:

Progress Example

My measurements are as follows:

  • UIProgressView length: 226 units
  • trackingImage.png: 10px
  • progressImage.png: 7px

Lastly, here are my custom images:

The Progress Image progressImage.png

The Tracking Image trackImage.png

  • 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-05-26T14:28:43+00:00Added an answer on May 26, 2026 at 2:28 pm

    Here’s what’s going on:

    The images you provide to the UIProgressView are basically being shoved in to UIImageViews, and the UIImageView is stretching the image to fill the space.

    If you simply do:

    [progressView setTrackImage:[UIImage imageNamed:@"track.png"]];
    

    Then you’re going to get weird results, because it’s trying to stretch a 10px wide image to fill (for example) a 100px wide image view. This means (roughly) that every pixel in the image will be repeated 10 times. So if the pixels in our image were:

    0123456789
    

    Then putting that image straight into a 100px wide image view would stretch it something like this:

    000000000011111111112222222222333333333344444444445555555555...
    

    This is what’s happening to you.

    What you really want to have happen is this:

    01234567812345678123456781234567812345678...123456789
    

    In other words, you want the image to have a 1 point left edge that is never stretched, the center to be tiled, and to have a 1 point right edge that is also never stretched. To do this, you’ll need to make the image resizable:

    UIImage *track = [[UIImage imageNamed:@"track"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 1, 0, 1)];
    [progressView setTrackImage:track];
    

    If you want this to tile appropriately vertically as well, then the edge insets should be {1, 1, 1, 1} (assuming you want a 1 point border).

    Do the same to the progressImage, and you’ll end up with something that looks correct:

    Correct progressView

    tl;dr:

    Your images need to be resizable.

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

Sidebar

Related Questions

I'm new to Objective-C here, and still learning its syntax, so I'm experimenting some
Experimenting with new features of T-SQL, I've run into a puzzle. Here is some
I am new to component creation and was experimenting with creating some of my
With the release of Gingerbread, I have been experimenting with some of the new
I am experimenting with some new ideas in Cocos2D/Box2D on iPhone. I want to
so I am new to JSON, and have been experimenting around with some possibilities.
I am new to Prolog and am experimenting around with some stuff, in particular
I'm experimenting with HTML5's new canvas tag, in which I render and animate some
I am new to visual studio and I am experimenting around with some Windows
I have been experimenting some problems with the fully distributed version. First of all

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.