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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:16:39+00:00 2026-05-25T00:16:39+00:00

I can’t seem to get text positioned in the same places on screens of

  • 0

I can’t seem to get text positioned in the same places on screens of different resolution. The problem is the text is floating, it’s not part of any layout type of control.

I try to position the text in relative units compared the screen size. For example, I put it at 50% on the X and 67.89% on the Y axis. Despite that, the text appears in a different location on different resolution screens.

So I’m stuck approximating the location for certain resolutions and this gets messy really fast.

How can I pin point a location on a canvas that is the same spot despite the DPI / screen size?

  • 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-25T00:16:40+00:00Added an answer on May 25, 2026 at 12:16 am

    Use DisplayMetrics to calculate the distance. For example if you always want the text to be 1.5 inches from the left and top.

    This will work with any View or Bitmap you drawing on.

    draw(Canvas canvas){
        Matrix identity = new Matrix; // Used to have canvas draw on
        Matrix savedMatrix = new Matrix();
        canvas.getMatrix(savedMatrix);
        canvas.setMatrix(identity);
    
        float y = displayMetrics.ydpi * 1.5;
        float x = displayMetrics.xdpi * 1.5;
    
        canvas.drawText(text, x, y + paint.getTextSize(), paint);
        canvas.setMatrix(savedMatrix);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can I change the field public virtual ClassOne ClassOne { get; set; } to
Can any one tell, how to get the result of LINQ query contains group
Can't seem to figure out what's wrong with the simple getJSON call below. It's
Can anyone tell me the exact syntax for NOT IN condition in SQL on
Can I use QT Creator for C (not C++) non-GUI programming on Linux? Or
Can i get the source code for a WAMP stack installer somewhere? Any help
Can we change the HTML or its attributes of the selected part of the
Can not find scala.actors package in latest milestones, while it still presents in scaladocs:
Can find why i get this error can someone help? package Android.data; public class
I've tracked down a weird MySQL problem to the two different ways I was

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.