1

Hi my code can any any one tell me how to scroll text in textview for android.

physical = new TextView(this);
positionView.setTextView(getResources().getString(R.string.textviewp), 0,"Physical", physical, ImageType.TEXT_VIEW_GOAL);
physical.setId(R.id.physical);
physical.setTextColor(Color.BLACK);
physical.setTextSize(18);
physical.setTypeface(fonts);
physical.setBackgroundColor(Color.parseColor("#FFFFFF"));
physical.setOnClickListener(onClickListener);
physical.setOnLongClickListener(OnLongClickListener);
ScrollGoalRelativeLayout.addView(physical);
0

1 Answer 1

3

set the android:maxLines and android:scrollbars = "vertical" properties of textview in xml file in layout.

After that use the TexView.setMovementMethod(new ScrollingMovementMethod()) in your code.

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.