xml-drawable Questions
0
I've successfully used theme attributes (ex. ?attr/colorPrimary) within a VectorDrawable loaded through VectorDrawableCompat. Is there a way to do the same with a simple Drawable containing a shape...
Shier asked 24/5, 2016 at 2:9
1
I'm trying to add support to tablets in my app and run into IllegalArgumentException thrown by this line of code:
marker.setIcon(BitmapDescriptorFactory.fromResource(R.drawable.arrow_green_10by19)...
Canner asked 25/10, 2015 at 3:0
3
Solved
I define following drawable my_background_drawable.xml:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
&...
Mok asked 17/11, 2011 at 14:58
2
I have this difficulty to have both rounded corner and a background image in my LinearLayout.
I know I can achive the rounded corner by using the shape drawable XML, but if I put the shape drawab...
Guinna asked 7/6, 2011 at 10:24
5
Solved
Context:
I'm developing an Android application for tablets (landscape) with image resources which has a resolution of 1920x1200. That resolution fits on the following screen sizes and densities:
d...
Stillage asked 9/8, 2014 at 15:34
1
Solved
I'm trying to create a drawable shape with different states for my button. So I wrote this:
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:state_pres...
Hubey asked 13/8, 2014 at 20:23
1
Solved
I have this code in an xml inside the drawable folder:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:s...
Catamite asked 12/7, 2014 at 21:9
3
Solved
I was wondering if anyone knows of a tool to generate xml selector files for your custom buttons. I'm getting a bit tired creating buttons, convert them to .9.png files and then copying and pasting...
Dexedrine asked 7/12, 2011 at 23:14
2
Solved
I have the folowing drawable,
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<corners android:...
Insufferable asked 17/9, 2013 at 14:31
1
Solved
What is the best way to set background for some view? For example 2 variants of backround:
background with gradient, rounded corners and border
background with just one color and rounded corners...
Idiotism asked 6/8, 2013 at 6:54
2
Solved
I don't understand how the layer-lists work. I read the official documentation with some examples but it does not work for me like expected. I want four squares which should be padded with 1dp, but...
Specialize asked 21/1, 2013 at 10:27
1
Solved
Consider the following layout:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:backgr...
Galactose asked 3/4, 2013 at 7:3
2
I have this shape in my drawable folder:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corne...
Crenellate asked 27/11, 2012 at 13:39
1
I have created a small test app to try out scale drawable.
I define my drawable in xml and save it as scale_up.xml. I have a main.xml layout file with an ImageView. I use android:src="@drawable/s...
Thurmond asked 26/3, 2012 at 14:30
3
Solved
I'm trying to simplify some graphics from requiring a 9-patch for each density, to just using an XML drawable. It's a fairly simple graphic:
2 Segments:
8dp wide for both segments
Top segment ...
Siftings asked 27/1, 2013 at 18:34
2
Solved
I have a textview i want to show a line below it. I am using the drawableBottom attribute to do this. Here is my code
<TextView
android:id="@+id/total"
android:layout_width="fill_parent"
and...
Maurer asked 18/1, 2013 at 7:30
2
Solved
The following is a dashed line, defined as a ShapeDrawable in XML:
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="line">
<size
android:height="2dp"
...
Herring asked 1/6, 2012 at 1:39
2
Solved
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 w...
Aetolia asked 11/4, 2011 at 16:42
1
Solved
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 eclips...
Churchy asked 29/9, 2012 at 23:17
3
Solved
I created a button in the layout . In the Drawable folder I created a XML file named btn01_state. The btn01_state.xml is assigned to the button i created through "android:background=@drawable/btn01...
Towage asked 6/5, 2012 at 11:53
1
Solved
I'm trying to bring out a glossy xml drawable gradient as a background to a layout. I am already using the start color and end color boring linear gradient.
<item>
<shape>
<gradi...
Striction asked 21/11, 2011 at 13:23
1
Solved
I have three 9-patch PNG's which together make up the background for a button (left side, middle, right side). I would like to combine these three images together in a drawable which I can specify ...
Subaxillary asked 29/9, 2011 at 17:52
1
Solved
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.
Describe asked 24/9, 2011 at 17:41
1
Solved
I am trying to work my way in UI. I am trying to set stateListDrawable for list entries. All I am trying to do is change the color of the list item's layout when the item is pressed, and while the ...
Balaam asked 17/2, 2011 at 19:36
1
Solved
I want to set a View background that is a regular grid of vertical stripes. The stripes alternate between two colors. (For example, across a single row, there might be 6 pixels of light gray follow...
Lour asked 18/2, 2011 at 17:25
© 2022 - 2024 — McMap. All rights reserved.