1

I have text view in Footer and I Want to Scroll that text in Footer. Here is my snippet of my Code but that text will not be scrollable . Any body can help me Thanks in Advance My Code

public class Footer extends RelativeLayout{ private TextView footer_TextVeiw; ImageView logout; public Footer(Context context, AttributeSet attrs) { super(context, attrs); String infService = Context.LAYOUT_INFLATER_SERVICE; LayoutInflater li = (LayoutInflater) getContext().getSystemService(infService); li.inflate(R.layout.footer_layout, this, true); footer_TextVeiw= (TextView) this.findViewById(R.id.text_Footer); footer_TextVeiw.setSelected(true); } } 

My XML Layout

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".Footer" > <TextView android:id="@+id/text_Footer" android:layout_width="fill_parent" android:layout_height="25dp" android:layout_alignParentBottom="true" android:background="#ECEFF5" android:layout_centerHorizontal="true" android:marqueeRepeatLimit="marquee_forever" android:singleLine="true" android:scrollHorizontally="true" android:ellipsize="marquee" android:text="@string/Footer" /> </RelativeLayout> 
1

2 Answers 2

1

You can try attribute android:scrollbars="vertical" or Horizontal

Sign up to request clarification or add additional context in comments.

4 Comments

Hi i tried with this but i cant get.. Simply the text oly getting as a view not in Scrollable
When there is a overflow of text than only textView come with the scroll bar...try to provide fixed width for the TextView
Thanks Pragnani its perfectly works for when we give certain fixed width for text view
@ManojKumar welcome friend...you can accept this as answer if you think it helps you..
1

set

android:maxLines = "AN_INTEGER" android:scrollbars = "vertical" 

in your TextView in xml file. and use

textView.setMovementMethod(new ScrollingMovementMethod()) 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.