I need to rotate my text view, so I just used this code:
<TextView
android:rotation="90"
android:layout_gravity="center"
android:id="@+id/price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/stock_price"
android:textAppearance="@style/font"
android:textColor="@color/gray" />
but the problem is just my text will rotate not text view. this is shown in the image below:
How can I rotate the whole text view not just its text? ( as you can see in the image, the text "my rotated text" is rotated for 90 degrees but textView, itself, is still in a horizontal line.
I also tried fixing that using animations. so I tried this code, but nothing changed:
binding.price.animate().rotation(90F).start()
any help will be appreciated.


