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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:49:11+00:00 2026-06-15T03:49:11+00:00

I have a meter as shown in the figure. I can able to move

  • 0

I have a meter as shown in the figure. I can able to move the needle across the meter, no problem with that. The problem is, I need to change the color codes in the meter dynamically according to the user input.

I am getting three values from the user. If the first value is 30, I need to set green color in the range 0 to 30. If the second value is 70, I need to set yellow color till the range 70. Similarly for the third value, I need to set the maximum value and the set the red color.
enter image description here

Changing the color code of a view is not a big deal. But, I have no idea how to dynamically set the colors in a particular range(irregular shape).

Edited: Currently I am just moving the needle across the meter (Moving an imageview inside a normal UIView). Expected output should be like the image attached and I had not set any colors now.

Help me to proceed. Thanks in advance..!

  • 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-15T03:49:12+00:00Added an answer on June 15, 2026 at 3:49 am

    I guess the most simplest way, would be –

    Add 3 separate UIView layers to parent UIView layer.

    all these 3 subview layers will have different colors – which can be dynamically changed.

    These subviews, are just plain rectangles.

    Now – this is where the fun begins:

    You must rotate and position each subview separately – accordingly how it should be.

    It also can be done dynamically, but it will be a bit harder.

    Just follow these tutorials to rotate UIView:

    http://iphonedevsdk.com/forum/iphone-sdk-development/4181-rotating-an-uiimageview-around-an-arbitrary-point.html

    Rotate a UIImageView around a point off screen? (center of uiImageView

    rotate UIView/UITableView around a point

    How to rotate view around anchor point multiple times

    And at the end – mask parent UIView, so that all subviews would be trimmed and appeared as irregular shapes.

    Here is a tutorial how to do it:
    How to mask an image in IOS sdk?

    Good luck!

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

Sidebar

Related Questions

I'have written a simple code, that gets accelerometer&orientation meter and display some graphics based
I have a project to do in Visual Basic. My problem is that the
I have a little problem with Excel. I nead to make a function that
i have questions that i am really need some help on it: i develop
I am currently trying to create a meter that can be adjusted in the
I have to develop an Intensity Meter, which will basically display the average intensity
I have a Meteor template that includes the following: {{#with selected_recipe}} {{>recipe}} {{/with}} In
have a problem. At first look at this HTML <div id=map style=background-image: url(map.png); width:
i've been trying to figure this out and i have absolutely no clue why
I have problem in validating Edittext in listview in onFocusChangeListner. My UI looks like

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.