如题。textview始终都是一个正方体。能不能通过某种方法将他变成梯形或其他形状

解决方案 »

  1.   

    <shape></shape>描边如椭圆
    <?xml version="1.0" encoding="utf-8"?>
    <shape xmlns:android="http://schemas.android.com/apk/res/android"
        android:shape="oval">
        <gradient
            android:startColor="#FFFF0000"
            android:endColor="#80FF00FF"
             android:type="linear"
            android:angle="0"/>
        <padding android:left="7dp"
            android:top="7dp"
            android:right="7dp"
            android:bottom="7dp" />
    <corners
            android:radius="40dip" />
    </shape><TextView  
        android:layout_width="80dip" 
        android:layout_height="60dip" 
        android:background="@drawable/shape"
        android:text="hello"/>