Skip to content

Calling requestLayout on setText #3

@sandransoria

Description

@sandransoria

First of all: Many thanks for this very useful implementation of a vertical text view. I'm using it for a personal project as a label for my charts.

But I got the following problem:
If I dynamically change the text of the view programmatically to a text which is longer than the one before, the new text will not be displayed correctly (it will basically be cut of or squeezed). Therefore I also overwrite setText in my project:

 public void setText(String text) {
        super.setText(text);       
        requestLayout();
        // redraw view with new layout
        invalidate();
    }

I don't know if this is the right way to do it, but in my case it worked.
Also I'm not sure if this is the correct place to post such stuff, but I hope this might be helpfull for others.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions