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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:52:55+00:00 2026-06-17T16:52:55+00:00

I am using below code to set text on the canvas..But now i want

  • 0

I am using below code to set text on the canvas..But now i want to know how to set the position of the text at the bottom of the layout..

    LinearLayout layout = new LinearLayout(getContext());
    TextView textView = new TextView(getContext()); 
    textView.setVisibility(View.VISIBLE);
    textView.setText(DetailsActivity.temp_desc);
    textView.setLines(10);
    textView.setSingleLine(false);
    layout.addView(textView);
    layout.measure(canvas.getWidth(), canvas.getHeight());
    layout.layout(0,100, canvas.getWidth(), canvas.getHeight());
    layout.draw(canvas);

Using this code i am getting text on position of (0,0) but i want to set it to (0,400) how can i achieve my requirement?

  • 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-17T16:52:56+00:00Added an answer on June 17, 2026 at 4:52 pm

    here is two sample code for draw text on canvas..

    1)Draw TextView on Canvas

    TextView textView = new TextView(getContext()); 
    
    textView.setText(DetailsActivity.temp_desc);
    textView.setMinLines(1);
    
    canvas.translate(0,bitmap.getHeight());
    textView.layout(0, 0, 500, 150);
    textView.draw(canvas);
    

    2)Draw text on canvas

    canvas.drawText("Value",x_position, y_position, your paint object);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am using below code to change the the font type of text view.
I have the below code example where I want to prepend some text on
I am trying to do the text box autocomplete by using the code below,
I am using the below code to replace some text which is working fine.
I am using the below code to set the character count on a textarea.
I am using below code to equal column height but its not calculating padding
I'm using the below code to find a resource by id ; setContentView(R.layout.golders); for
i am using below code to show google map in asp.net MVC2: <script type=text/javascript
I am using the code below to set a UITableViewCell's accessory to a checkmark
I am using below code to upload excel and INSERT in mysql in php

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.