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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:45:56+00:00 2026-06-04T12:45:56+00:00

I tried a lot for having scrolling text horizontally inside a listview. i want

  • 0

I tried a lot for having scrolling text horizontally inside a listview.
i want one of my textview to scroll horizontally automatically like marquee
iam able to set horizontal scroll bar and scroll on touching it as

TVad.setMovementMethod(new ScrollingMovementMethod());

This is my xml file

<?xml version="1.0" encoding="utf-8"?>

<TextView
    android:id="@+id/tvinboxname"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceMedium" />

<TextView
    android:id="@+id/tvinboxmsg"    
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@+id/tvinboxname"
    android:maxLength="10"
    android:textAppearance="?android:attr/textAppearanceMedium" />

<TextView
    android:id="@+id/tvtimeStamp"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentRight="true"
    android:layout_below="@+id/tvinboxmsg"
    android:textAppearance="?android:attr/textAppearanceSmall" />


    <TextView
        android:id="@+id/tvadmsg"
        android:layout_width="wrap_content"

        android:layout_height="wrap_content"
        android:layout_below="@+id/tvtimeStamp"
        android:ellipsize="marquee"
        android:focusableInTouchMode="true"
        android:inputType="text"
        android:focusable="true"
        android:marqueeRepeatLimit="marquee_forever"
        android:lines="1"
        android:scrollHorizontally="true"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:textColor="#330066" />

and in my getview method

    // @Override
        public View getView(final int position, View convertView,
                ViewGroup parent) {
            convertView = inflater.inflate(R.layout.inboxtextviews, null);
            Tvname = (TextView) convertView.findViewById(R.id.tvinboxname);
            Tvname.setText(VCAESInboxWithOutCheckboxes.Inboxlist.get(position)
                    .getname());
            TVmsg = (TextView) convertView.findViewById(R.id.tvinboxmsg);
            TVmsg.setText(VCAESInboxWithOutCheckboxes.Inboxlist.get(position)
                    .getmessage());
            TVtimeStamp = (TextView) convertView.findViewById(R.id.tvtimeStamp);
            TVtimeStamp.setText(VCAESInboxWithOutCheckboxes.Inboxlist.get(
                    position).getTimeStamp());

            TVad= (TextView) convertView.findViewById(R.id.tvadmsg);

            TVad.setText(VCAESInboxWithOutCheckboxes.Inboxlist.get(
                    position).getAd());

            TVad.setSelected(true);
);
            return convertView;
        }

i searched a lot on this in stackoverflow and not able to display the scrolling text.

  • 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-04T12:45:57+00:00Added an answer on June 4, 2026 at 12:45 pm

    Use custom class as shown below and

     public class MyTextView extends TextView{
    
     public MyTextView(Context context, AttributeSet attrs, int defStyle) {
            super(context, attrs, defStyle);
            init();
            rotate();
        }
    
        public MyTextView(Context context, AttributeSet attrs) {
            super(context, attrs);
            init();
            rotate();
        }
    
        public MyTextView(Context context) {
            super(context);
            init();
            rotate();
        }
    
        private void rotate() {
            // TODO Auto-generated method stub
            setSelected(true);
        }
    
        private void init() {
            if (!isInEditMode()) {
    
            }
        }
    
    
      }
    

    add it in xml file for custome listview like shown below

        <Your Package Name.MyTextView
        android:layout_marginTop="10dip" android:id="@+id/tv_parse"
        android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentTop="true"
            android:layout_centerHorizontal="true"
            android:textSize="22px"
            android:textColor="#34A4c5"
            android:ellipsize="marquee"
            android:maxWidth="220dp" 
            android:fadingEdge="horizontal"
            android:marqueeRepeatLimit="marquee_forever"
            android:scrollHorizontally="true"  
            android:singleLine="true"
            android:layout_marginLeft="10dp"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:layout_marginRight="10dp"></Your Package Name.MyTextView>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I searched and tried a lot, but I can't accomplish it as I want..
I have tried making a switch like statement in python, instead of having a
I'm having a lot of trouble with what seems like a very simple thing.
I am having a lot of trouble with a text file given to me
I've been having a lot of trouble with this problem. I have a listview
I tried a lot of the solutions in stackoverflow but I'm not able to
I've read through the other excellent stack overflow articles and tried a lot of
The question seems straight forward. I tried a lot of things just to include
I can't get expand_aliases to take effect in bash. I've tried a lot of
I have searched a lot and tried much but I can not find the

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.