Make a view with rectangle shape using xml definitions (drawable) in Android

安稳与你 提交于 2019-12-25 08:59:31

问题


https://drive.google.com/file/d/0B0vP0ppNf8G3MFdBRmF5WkJEZ3c/view?usp=sharing

I want to create shape as above. How do you create this using xml?


回答1:


<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:right="-100dp">
        <rotate
            android:fromDegrees="-5"
            android:pivotX="0%"
            android:pivotY="100%">
            <shape android:shape="rectangle">
                <solid android:color="#f9c" />
            </shape>
        </rotate>
    </item>
</layer-list>


来源:https://stackoverflow.com/questions/30635406/make-a-view-with-rectangle-shape-using-xml-definitions-drawable-in-android

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!