Vertical TextView taking too much space in Android

后端 未结 11 1663
鱼传尺愫
鱼传尺愫 2021-02-01 04:02

I am trying to create something like the following using LinearLayout and TableLayout:

\"enter

相关标签:
11条回答
  • 2021-02-01 04:19
        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()
    
    0 讨论(0)
  • 2021-02-01 04:22

    You can use code below:

    android:rotation="270"
    
    0 讨论(0)
  • 2021-02-01 04:24

    why not put padding?so it will go in the center of your screen.just try it out if you like

    0 讨论(0)
  • 2021-02-01 04:26

    You should get answer to your question from the below mentioned link:

    vertical text in textview

    0 讨论(0)
  • 2021-02-01 04:26

    you have to extend TextView and override its onDraw

    0 讨论(0)
  • 2021-02-01 04:26
            android:rotation="-90"
            android:layout_gravity="center"
    

    Worked for me.

    0 讨论(0)
提交回复
热议问题