I am trying to create something like the following using LinearLayout and TableLayout:
val textPaint = Paint(Paint.ANTI_ALIAS_FLAG)
textPaint.textSize=toPx(16)
textPaint.color=Color.parseColor("#FFFFFF")
canvas.save()
canvas.translate(50F, 60F)
canvas.rotate(90F)
canvas.drawPaint(textPaint)
canvas.drawText("YourText", 0F,0F, textPaint)
canvas.restore()
You can use code below:
android:rotation="270"
why not put padding?so it will go in the center of your screen.just try it out if you like
You should get answer to your question from the below mentioned link:
vertical text in textview
you have to extend TextView
and override its onDraw
android:rotation="-90"
android:layout_gravity="center"
Worked for me.