0

In layout there is textview. And i want to show the text in some angle(in cross) instead of horizontal. Is it possible?

Thank you.

Zeel
  • 236
  • 5
  • 15

2 Answers2

2

Using Xml:

<TextView 
        ...
        android:rotation="45" />

Using Code:

myTextView.setRotation(45f);

For API 10 and below, must be done through code:

RotateAnimation animation = new RotateAnimation(45f, 45f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
animation.setInterpolator(new LinearInterpolator());
animation.setDuration(1);
animation.setFillAfter(true);
myTextView.startAnimation(animation);
Dusan
  • 5,000
  • 6
  • 41
  • 58
0

This is a very similar question to a previous post. Check out the accepted answer here: android text view text in vertical direction

I don't believe there's an "easy" way to do it without some customization of the textview class.

Community
  • 1
  • 1
SBerg413
  • 14,515
  • 6
  • 62
  • 88