xml-drawable

How to make round corners for a ring shape in Android drawable

三世轮回 提交于 2021-01-27 02:26:08
问题 I have a custom progress bar that looks like this: Here's the .xml code I've used to create it: background_drawable.xml <?xml version="1.0" encoding="UTF-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:innerRadius="@dimen/progress_bar_radial_inner_radius" android:thickness="@dimen/progress_bar_radial_thickness" android:shape="ring" android:useLevel="false" > <solid android:color="@color/main_color_alpha"/> </shape> progress_drawable.xml <?xml version="1.0"

“Nothing to show” when I tried to insert a new Vector Asset in Android Studio

两盒软妹~` 提交于 2020-11-24 18:07:39
问题 "Nothing to show" error - vector asset Hey, all. So, recently I updated my Android Studio Version to 4.1 (the latest version). I wanted to add a vector asset just like the usual but..somehow..the preview of the icons did not show up. I can't choose a vector asset or even add one. Is there any way to fix this? Or maybe, a way to downgrade the version? Thank you so much :( 回答1: This problem seems to be originated with the Android Studio Windows version 4.1. I have the same exact problem and I

“Nothing to show” when I tried to insert a new Vector Asset in Android Studio

风流意气都作罢 提交于 2020-11-24 18:00:17
问题 "Nothing to show" error - vector asset Hey, all. So, recently I updated my Android Studio Version to 4.1 (the latest version). I wanted to add a vector asset just like the usual but..somehow..the preview of the icons did not show up. I can't choose a vector asset or even add one. Is there any way to fix this? Or maybe, a way to downgrade the version? Thank you so much :( 回答1: This problem seems to be originated with the Android Studio Windows version 4.1. I have the same exact problem and I

“Nothing to show” when I tried to insert a new Vector Asset in Android Studio

点点圈 提交于 2020-11-24 17:57:12
问题 "Nothing to show" error - vector asset Hey, all. So, recently I updated my Android Studio Version to 4.1 (the latest version). I wanted to add a vector asset just like the usual but..somehow..the preview of the icons did not show up. I can't choose a vector asset or even add one. Is there any way to fix this? Or maybe, a way to downgrade the version? Thank you so much :( 回答1: This problem seems to be originated with the Android Studio Windows version 4.1. I have the same exact problem and I

Why does the inner circle fill the outer circle?

心已入冬 提交于 2020-01-26 01:20:29
问题 I'm trying to make a small dark circle within a large light circle using xml in Android. Both circles have a color, a size and a stroke. Why does the small dark circle fill the 50 dp instead of being 28dp? <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <!--big light circle--> <item> <shape android:shape="oval"> <solid android:color="#EEEEEE" /> <size android:width="50dp" android:height="50dp" /> <stroke android:width="2dp"

Adding android drawable to menu XML stop app compiling

血红的双手。 提交于 2020-01-15 12:08:17
问题 I am working on an android project and have an XML file for the action bar menu, its been working fine, but I now need to add an extra item with an icon, but it this displays an error in the eclipse tab and the console output. If I remove the icon field, then its fine, but if I add the icon, then I get the error. Below is the XML that contains the menu item. I've included one item that previously worked and the new item that isn't working <item android:id="@+id/mnu_search" android:title=

Rectangle inside another rectangle

亡梦爱人 提交于 2020-01-12 05:47:07
问题 Is it possible to create drawable from xml like on the picture? The first rectangle contains a second rectangle. If yes, please explain to me how. 回答1: If you want simple rectangles you could use a LayerList with two shapes as content: <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <shape android:shape="rectangle"> <solid android:color="#a1a1a1" /> </shape> </item> <item android:top="5dp" android:right="5dp" android:bottom

app:srcCompat - Vector drawable shows up in design preview, but doesn't show up in app

心不动则不痛 提交于 2020-01-11 09:10:12
问题 drawable/information.xml <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24.0" android:viewportHeight="24.0"> <path android:fillColor="#FF000000" android:pathData="M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0,0 0,2 12A10,10 0,0 0,12 22A10,10 0,0 0,22 12A10,10 0,0 0,12 2Z"/> </vector> LayoutofCardView.xml <ImageView android:layout_width="24dp" android:background="#f00" android:layout_height="24dp" android:id="@

Android: How to Make A Drawable Selector

孤者浪人 提交于 2019-12-28 03:01:46
问题 I feel like this is kind of a silly question, but here I go anyways. I have an image button, and I want to be able to change it's image everytime it is clicked. The API seems to say that the best way to go about doing this is to create xml resource in the drawable folder that contains a selector and values. However when I go to make a new android xml resource, there's no option for drawables. What am I missing? 回答1: As far as I know, the Android XML editor doesn't allow you to create XML

Circle drawable looks like oval on map

纵然是瞬间 提交于 2019-12-25 04:58:11
问题 Hi I am trying create circle shape on map. For that i am using ground overlay item. I tried draw circle shape with drawable xml file. First I tried in normal activity layout and it shows me perfect circle shape. same thing I tried to draw on map it looks like oval shape. My code for drawable and layout is as follows : <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval"> <solid android:color="#666666"/> <size android