美文网首页高级UI
Android一个倾斜的TextView,适用于标签效果

Android一个倾斜的TextView,适用于标签效果

作者: Perston | 来源:发表于2020-07-15 16:51 被阅读0次

    描述:

    android一个倾斜的TextView,适用于标签效果

    应用截图:

    111.jpg

    使用说明:

    <com.haozhang.lib.SlantedTextView
        android:layout_width="80dp"
        android:layout_height="80dp"
        android:gravity="center"
        app:slantedBackgroundColor="@color/secondary_text"
        app:slantedLength="40dp"
        app:slantedMode="left"
        app:slantedText="IOS"
        app:slantedTextColor="@color/primary"
        app:slantedTextSize="16sp"
        />
    
        SlantedTextView stv = (SlantedTextView) findViewById(R.id.test);
    
        stv.setText("PHP")
                .setTextColor(Color.WHITE)
                .setSlantedBackgroundColor(Color.BLACK)
                .setTextSize(18)
                .setSlantedLength(50)
                .setMode(SlantedTextView.MODE_LEFT);
    

    源码下载:https://github.com/HeZaiJin/SlantedTextView

    相关文章

      网友评论

        本文标题:Android一个倾斜的TextView,适用于标签效果

        本文链接:https://www.haomeiwen.com/subject/tprjhktx.html