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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:01:53+00:00 2026-06-18T06:01:53+00:00

I am working on a custom View that includes frequently updated text that I

  • 0

I am working on a custom View that includes frequently updated text that I want to anchor to the bottom of the canvas.

The text length changes as well, and I’d like it to wrap, moving up the screen as more lines are needed. (DynamicLayout thus seems like a solid choice for automating this)

However, I don’t see any options in the docs about specifying where on my canvas the text is drawn or in which direction it should “grow”.

Here is my initialization:

TextPaint subtleTextPaint = new TextPaint();
DynamicLayout dl = new DynamicLayout(text,subtleTextPaint,getWidth()
    ,Layout.Alignment.ALIGN_CENTER,1,0,true);

And in onDraw(), I simply pass the canvas to the DynamicLayout object like so:

dl.draw(c);

Right now, the text is drawn at the very top of the screen and word-wraps downwards as the text gets longer.

  • 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-18T06:01:54+00:00Added an answer on June 18, 2026 at 6:01 am

    After quite a bit of searching, I found nothing that did what I wanted. So, in true hacker style, I created my own solution. By extending the DynamicLayout class and overwriting the getLineTop() function, I was able to achieve the functionality I was looking for.

    I’ve posted the source code here.

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

Sidebar

Related Questions

So, I'm working on an Eclipse Plugin which includes a custom view based on
I have a custom view that extends ViewGroup . It includes a ProgressBar and
Background: I am working on an iPad app that will pop a custom view
I had a custom view with subclassed touch responses that was working in iOS
I have a nicely working custom CursorAdapter with customized ListView. This view allows the
I am working on adding a custom accessory view, (a button) to a UITableViewCell,
I am currently working on MGSplitViewController .So in this custom split view controller the
I have set onItemClicklistener on my custom list view but onItemClicklistener not working I
I have a working custom UserNamePasswordValidator that calls into my Oracle DB. This class
So I have a Custom Container View Controller that I'm setting up and I

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.