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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:17:45+00:00 2026-06-15T21:17:45+00:00

I am implementing a tag system into my app, and for this to happen

  • 0

I am implementing a tag system into my app, and for this to happen I need a background image of the tag and the text to overlay that image. The problem is though – how can I stretch the image to ‘fit’ the text? ‘Maths’ works fine, but a word like ‘Economics’ would not as it would overlap the background image.

This is what my tag looks like:

  • 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-15T21:17:46+00:00Added an answer on June 15, 2026 at 9:17 pm

    You first need to calculate the expected size of text and then give frame to image accordingly.You can use the image with cap width and cap height if required. Here is the code snippet.

        CGSize maximumLabelSize = CGSizeMake(600,52);  // maximum possible size
        CGSize expectedLabelSize = [brandName sizeWithFont:[UIFont fontWithName: @"Helvetica-Bold" size:20] 
                                         constrainedToSize:maximumLabelSize 
                                             lineBreakMode:UILineBreakModeTailTruncation]; 
    
        UIImage *centerStretchedImage =[[UIImage imageNamed:@"yourImage.png"] stretchableImageWithLeftCapWidth:10.0 topCapHeight:0];
    
        CGRect frame = CGRectMake(x, y, expectedLabelSize.width+20,52);
        UIImageView *dynamicImage = [[UIImageView alloc] initWithFrame:frame];
        dynamciImage.image = centerStretchedImage;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm implementing a tagging system on a blog app. This app has posts, posts
We're currently implementing a little tag system into our software. There are just two
I am implementing a tagging system for a website that uses JDO . I
its when i starting trying implementing this that i got quite stuck. some business
I'm implementing Comet using the script tag long polling technique, based on this page
I've read that the <marquee> tag is to return in html5... however, I need
I'm implementing a tag system similar to StackOverflow tag system. I was thinking about
What is the idea behind implementing a tagging system like Stack Overflow? This is
implementing publishActivity in PHP using the REST API using this code: $activity = array(
Implementing a custom membership provider, there are certain properties such as MinRequiredPasswordLength that only

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.