shreedhar
shreedhar

Reputation: 51

TextView intercepting touch events while scrolling in ViewPager

There's a TextView inside a ViewPager, when the ViewPager is scrolled from a portion near TextView the scroll event is intercepted by TextView itself.

This TextView is in relative layout of fragment in ViewPager

<TextView

                android:id="@+id/tv_course_name"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="Example Course"
                android:singleline="true"
                android:ellipsize="marquee"
                android:marqueeRepeatLimit="marquee_forever"
                android:gravity="center"
                android:textColor="@color/black"
                android:textSize="15sp"
                android:textStyle="bold"/>

Upvotes: 3

Views: 132

Answers (1)

user7359904
user7359904

Reputation:

Try replacing android:singleLine="true" with android:maxLines="1"

Happy Coding.

Upvotes: 1

Related Questions