小编use*_*848的帖子

在-90度旋转总Textview

我想在-90度设置我的textview意味着我要像这样展示它!我想在单线性布局中显示8个textviews.我能够旋转,但我只能看到一个textview.Please任何人都可以帮我一些例子.

在此输入图像描述

提前致谢.

public class AngledTextView extends TextView
{ 

       public AngledTextView(Context context, AttributeSet attrs) 
       { 
          super(context, attrs); 
       } 

       @Override 
       protected void onDraw(Canvas canvas) 
       { // Save the current matrix 
         canvas.save(); 
         // Rotate this View at its center 
         canvas.rotate(270,this.getWidth()/2, this.getHeight() /2); 
         // Draw it 
         super.onDraw(canvas); 
         // Restore to the previous matrix 
         canvas.restore(); 
        } 
 } 
Run Code Online (Sandbox Code Playgroud)

android rotation textview

1
推荐指数
1
解决办法
5256
查看次数

标签 统计

android ×1

rotation ×1

textview ×1