[英]How to create half circle filled shape using xml drawable in android?
[英]How to create custom shape using XML as a drawable in Android?
你可以使用一些工具來設計你的 SVG 文件,比如Android Vector Asset Studio
通常人們不會自己編寫 SVG 路徑,他們會使用工具或編輯器來繪制圖形並生成文件。
您需要做的是使用 SVG 編輯器(例如Inkscape (我使用的))創建 SVG 圖像,或者如果您想要更專業(和昂貴)的編輯器,您可以使用Adobe Illustrator 。 您甚至可以使用可在瀏覽器中訪問的名為svg-edit的工具。
創建所需的藝術作品后,保存您的 SVG 文件。 接下來轉到並打開Android Studio。
注意:為確保向后兼容,請將以下內容添加到 build.gradle
android{
defaultConfig{
vectorDrawables.useSupportLibrary = true
}
}
dependencies{
compile 'com.android.support:appcompat-v7:23.2.0'
}
希望這對你有幫助。 有關更多信息,請參閱 官方文檔。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.