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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:07:02+00:00 2026-06-12T08:07:02+00:00

I got texture, which really shorter, than my UIButton. I got this texture: And

  • 0

I got texture, which really shorter, than my UIButton.

I got this texture:

enter image description here

And i should create this button:

enter image description here

How should i stretch (not tile), this texture? Stretching in horizontal direction

Thnx

  • 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-12T08:07:03+00:00Added an answer on June 12, 2026 at 8:07 am

    From the example images you provided I’m pretty sure you’re looking for UIImage‘s resizableImageWithCapInsets:

    UIImage *originalImage = [UIImage imageNamed:@"myImage.png"];
    UIEdgeInsets insets = UIEdgeInsetsMake(top, left, bottom, right);
    UIImage *stretchableImage = [originalImage resizableImageWithCapInsets:insets];
    [myButton setBackgroundImage:stretchableImage forState:UIControlStateNormal];
    // the image will be stretched to fill the button, if you resize it.
    

    The values in the UIEdgeInsets struct determine the margins you don’t want to be stretched. Your left and right values could be about this wide:

    enter image description here

    The top and bottom values can be either 0 (if you don’t want to resize the button vertically), or probably half of the total height.

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

Sidebar

Related Questions

I've got a texture in which I want to set the alpha for a
I was working through texture mapping and I found this example which I cant
I got some problem with texture transparency, I hope ya can help. Details: XNA
Got this error message while trying to load view: The model item passed into
Got a question for some jQuery wizard who might stumble upon this. When I
got a problem, can't get my head around this jquery and would appreciate your
I've got an UIImageView as a background image for my application, which, like a
I have a billboard quad with a texture mapped onto it. This is basically
I'm writing some code which is intended to: 1. Render into an OpenGL texture
I've got PVR texture compression working all happy and good in my 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.