Android 文字傾斜,android文字傾斜
有時候Android內建的控制項無法滿足我們的某些要求,這時就需要我們自訂控制項來實現這些功能。比如需要一個TextView裡的字傾斜一定的角度,就需要自訂TextView。
package com.leigo.ratatetextview;import android.content.Context;import android.content.res.TypedArray;import android.graphics.Canvas;import android.util.AttributeSet;import android.view.Gravity;import android.widget.TextView;/** * Created by Administrator on 2014/9/9. */public class RotateTextView extends TextView { private static final int DEFAULT_DEGREES = 0; private int mDegrees; public RotateTextView(Context context) { super(context, null); } public RotateTextView(Context context, AttributeSet attrs) { super(context, attrs, android.R.attr.textViewStyle); this.setGravity(Gravity.CENTER); TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.RotateTextView); mDegrees = a.getDimensionPixelSize(R.styleable.RotateTextView_degree, DEFAULT_DEGREES); a.recycle(); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); setMeasuredDimension(getMeasuredWidth(), getMeasuredWidth()); } @Override protected void onDraw(Canvas canvas) { canvas.save(); canvas.translate(getCompoundPaddingLeft(), getExtendedPaddingTop()); canvas.rotate(mDegrees, this.getWidth() / 2f, this.getHeight() / 2f); super.onDraw(canvas); canvas.restore(); } public void setDegrees(int degrees) { mDegrees = degrees; }}
<?xml version="1.0" encoding="utf-8"?><resources> <declare-styleable name="RotateTextView"> <attr name="degree" format="dimension" /> </declare-styleable></resources>
用法:
1.xml
<com.leigo.ratatetextview.RotateTextView xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/text" android:text="@string/hello_world" app:degree="10dp" android:padding="10dp" android:layout_width="wrap_content" android:layout_height="wrap_content" /></span>
2.java
RotateTextView mText = (RotateTextView) findViewById (R.id.text);mText.setDegrees(10);</span>
項目地址:
https://coding.net/u/leigo/p/RotateTextView/git
coreldraw裡傾斜字怎做
看圖
安卓手機軟體哪款來編輯圖片裡的文字最好用,我主要來編輯文字,別的不用了,要可以調節方向傾斜與顏色,
1:Adobe Photoshop Touch
安卓版的PHOTOSHOP。。。PC最強P圖軟體的安卓版。。。。。缺陷是只支援大屏手機。。。否則顯示不完整。。。還有就是手機操作不太方便。。。但功能絕對沒的說
2:PicSay Pro
小螢幕可用最強P圖軟體。。。此軟體有漢化版。。只是沒找到,所以只好弄個英文版。。。確實非常強大。。已經達到早期PC版美圖秀秀的水平了。。而且操作非常舒服。。
3:WPS FOR ANDROID
編輯文字這個就是王道了。。。。你懂的
4:AUTODESK SKETCHBOOK MOBILE
一寬蘋果電腦上著名向量繪畫軟體的安卓手機版。。AUTODESK出品。。。