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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:36:08+00:00 2026-06-14T23:36:08+00:00

I am implementing an app with a trackbar which itself is a view and

  • 0

I am implementing an app with a trackbar which itself is a view and it needs to display the minimum and maximum values (of the variable which is associated with the bar) so I have added two labels to the top left and top right of it. Think of something like this without an enabled slider:

http://tdwiki.daverabelink.net/images/4/42/TrackbarSample.jpg

I would like to be able to shrink or magnify this view with pinch gesture and the below code does work fine :

-(void) handlePinch:(UIPinchGestureRecognizer *)gr
{
    //Shrinking
    if(gr.scale < 1)
    {
        //Get screen width
        CGFloat screenWidth = [UIScreen mainScreen].bounds.size.width;
        //If the view's would be size is smaller than half the screen's size then don't do anything
        //Otherwise shrink the view
        if(self.frame.size.width * gr.scale >= screenWidth / 2)
        {
            //Only scale on x axis, y axes stays the same
            self.transform = CGAffineTransformScale(self.transform, gr.scale, 1);
        }

    }
    //Magnifying
    else if (gr.scale > 1) 
    {
        //Only scale on x axis, y axes stays the same
        self.transform = CGAffineTransformScale(self.transform, gr.scale, 1);
    }

    //Set scale amount back to 1
    gr.scale = 1;
}

The problem is when the view is shrank the labels on top left and right are also shrank and their font size gets smaller. Since I scale the view only horizontally this looks bizarre. I want to set the labels’ size constant and shrink everything else inside the view.

I have tried to assign a new frame rectangle with the original labels’ sizes after shrinking but it didn’t work.Do you have any tips?

edit : Setting minimumFontSize property did not work either (I don’t try minimumScaleFactor because I’m still using ios 5 sdk)

  • 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-14T23:36:09+00:00Added an answer on June 14, 2026 at 11:36 pm

    I found the solution in separating my trackbar from the view that shall support pinch gesture. It was bad design to include trackbar in it beforehand, check your ui design before putting effort on more complicated stuff.

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

Sidebar

Related Questions

I have a question regarding uitable view. I am implementing an app which is
i am implementing one app related to animation. My require ment is, i have
I have a Rails app implementing a game, so it's expected that a player
It seems like implementing web-app like twitter/facebook-wall needs 1 huge feeds relational table (+
I am implementing a Twitter app, where the app needs to cache details of
I'm implementing a web app, which uses sessions. I'm using GWT and app engine
i am implementing an app that has 2 images that i need to display
I am implementing an app in which i need to flip/pagecurl a pageview? how
i have done implementing mobile app on android,webos,blackberry,iphone. now i integrate project with .net
I am implementing an app, which will be updatable by downloading new version from

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.