TextView文字旋转
来源:互联网 发布:云计算工程师做什么 编辑:程序博客网 时间:2024/06/08 18:58
Android TextView文字旋转45°效果图如图:
图片资源:
RotateTextView:
- import android.content.Context;
- import android.graphics.Canvas;
- import android.util.AttributeSet;
- import android.widget.TextView;
- /**
- *
- * @author Tyler
- * @time 2015-11-25 下午1:45:07
- */
- public class RotateTextView extends TextView{
- public RotateTextView(Context context) {
- super(context);
- }
- public RotateTextView(Context context, AttributeSet attrs) {
- super(context, attrs);
- }
- @Override
- protected void onDraw(Canvas canvas) {
- //倾斜度45,上下左右居中
- canvas.rotate(45, getMeasuredWidth()/2, getMeasuredHeight()/2);
- super.onDraw(canvas);
- }
- }
- <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical"
- android:background="@color/white" >
- <包名.RotateTextView
- android:layout_width="54dip"
- android:layout_height="54dip"
- android:layout_alignParentRight="true"
- android:background="@drawable/e_rotate_bg2"
- android:gravity="center"
- android:paddingBottom="17dp"
- android:text="进行中"
- android:textColor="#fff"
- android:textSize="12sp" />
- </RelativeLayout>
1 0
- TextView 旋转文字
- 自定义textview旋转文字
- TextView文字旋转
- textview旋转文字
- Android 怎么旋转TextView文字显示方向
- 自定义竖直旋转显示文字的TextView
- 如何高雅的旋转textview文字显示
- Android TextView文字旋转45°
- 自定义竖直旋转显示文字的TextView
- 自定义竖直旋转显示文字的TextView
- 利用TextView中的DrawableTop实现图片在文字上方,点击TextView能实现图片旋转
- 文字旋转
- 旋转文字
- 文字旋转
- 自定义旋转TextView控件
- 旋转的TextView-RotateTextView
- Textview 文本旋转,倾斜
- Android TextView旋转
- python3的requests抓取中文页面出现乱码
- 7.30Oracle Net管理错误
- Linux 进程间通信
- android genymotion下载地址
- 秒杀系统架构分析与实战
- TextView文字旋转
- 关于SpringMvc中使用aop的问题
- Redux和Reflux研究
- Android错误记录—— No such file or directory (2)
- 约瑟夫环---数学公式求解
- iOS 关于IMP指针的作用
- 京东咚咚架构演进
- Data Binding 指南
- setEdgesForExtendedLayout