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

  • Home
  • SEARCH
  • 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 9245113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:11:33+00:00 2026-06-18T09:11:33+00:00

I am experiencing a rather strange bug with TextView on Android. The text can

  • 0

I am experiencing a rather strange bug with TextView on Android. The text can flow over TextView’s top border at random times then user interacts with it. It looks like this happens when TextView changes it height with animation (it expands and shrinks on click).

So here how it looks (views borders drawing enabled with android dev tools, and I’ve marked TextView’s borders with red ) http://s7.postimage.org/c1ynrbwjv/so_full.png

I’ve tried calling invalidate() (postInvalidate() either), requestLayout() and resetting gravity of TextView.
I also tried to rewrite expanding and shrinking animation, to use getLayoutParams().height to set height, instead of setMaxHeight().
At the end I’ve put TextView into LinearLayout (setting TextView height to layout_height=”wrap_content”), and expanding/shrinking LinearLayout instead of TextView (so TextView’s bounds doesn’t change directly). But that, as you can guess, didn’t help.

TextView layout (BoardPostText extends TextView):

<my.package.view.BoardPostText
    android:id="@+id/postText"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_below="@id/postTitle"
    android:clickable="true"
    android:linksClickable="true"
    android:longClickable="true"
    android:maxHeight="@dimen/post_image_max_height"
    android:paddingLeft="5dp"
    android:textColor="@color/post_data_text_color"
    android:textSize="@dimen/post_data_text_size"
    android:textColorLink="@color/post_link_color" />

TextView’s code https://gist.github.com/d47e8eafb1bcff7c8db1

  • 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-18T09:11:34+00:00Added an answer on June 18, 2026 at 9:11 am

    I’ve found that such behaviour occured then MotionEvent happened over hyperlink. Because I only need spans to be clickable, I made such workaround:

    public static class JustClickableMethod extends LinkMovementMethod {
    
        public static MovementMethod getInstance() {
            return new JustClickableMethod();
        }
    
        @Override
        public boolean onTouchEvent(TextView widget, Spannable buffer, MotionEvent event) {
    
            int action = event.getAction() & MotionEvent.ACTION_MASK;
    
            if( action != MotionEvent.ACTION_UP ) {
    
                return true;
            }
    
            return super.onTouchEvent(widget, buffer, event);
        }
    
    }
    

    After setting this movement method to TextView clickable spans still get onClick() event, but bug with text flowing disappears.

    I think this is because LinkMovementMethod is “A movement method that traverses links in the text buffer and scrolls if necessary. Supports clicking on links with DPad Center or Enter. “

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

Sidebar

Related Questions

I'm experiencing a rather strange problem with foreign keys, namely this doesn't work as
I just installed 64-bit Eclipse 3.5.1 on SnowLeopard. I am experiencing a rather strange
I’m experiencing a rather strange problem with WPF. When I place buttons on a
I am experiencing a rather strange problem using PHP 5.3's date diff function to
Im experiencing a strange situation which i was supposed to handle. The situation is:
I am experiencing some strange problems with NHibernate and the usage of proxy items
I'm experiencing some difficulties doing a rather simple thing, I'm missing something but don't
I'm experiencing an intermittent problem with a class that extends javax.swing.text.DefaultStyledDocument . This document
I've come across a strange render bug on iPhone OS 3.0... I have two
I am experiencing some strange behavior with SQL Server CE 3.5 SP2. I have

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.