Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
102 views
in Technique[技术] by (71.8m points)

android - How to preview xml drawable?

I'm working on pretty complex xml drawable and i was wondering if there is any tool/plugins which allow me to preview my drawable ?

I'm looking for something similar to the "Graphical layout" tab available for layout.

For example if i have something like this :

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">

    <item android:left="0dp" android:right="0dp"> 
        <shape android:shape="rectangle">

            <gradient android:angle="-90" android:startColor="#2B2B2B"
                android:endColor="#000000" />

        </shape>
    </item>
    <item android:top="1sp" android:bottom="26sp" > 
        <shape android:shape="rectangle">
            <solid android:color="#10ffffff"/>
    </shape>

    </item>
</layer-list>

How can i preview the shape and gradient ? And i'm probably dreaming , but is there any graphical tools to build a drawable ?

question from:https://stackoverflow.com/questions/11018166/how-to-preview-xml-drawable

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

In Android Studio do this: View -> Tool Windows -> Preview


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...