Questions tagged [android-shape]

This is a generic shape defined in XML.

This is a generic shape defined in XML.

Reference: http://developer.android.com/guide/topics/resources/drawable-resource.html#Shape

191 questions
0
votes
1 answer

Android: Generate Background shape with specified color bottom

I want to generate background drawable shape which has grey color and bottom is 2dp thick and of black color. I have tried the following
LearningBasics
  • 660
  • 1
  • 7
  • 24
0
votes
1 answer

Android multi shape drawable

Hi I'm trying to make a drawable which looks like a small vertical line with a circle attached to the bottom of it. I am trying to figure out if creating such a shape in a single xml file is possible (I know I could probably place two shapes on top…
AIntel
  • 1,087
  • 5
  • 14
  • 27
0
votes
2 answers

How to make a layout is totally wrap content the background in the drawable folder?

i have an issue here. I have an .xml file in the drawable which is the android:shape="line". below is the code: when this .xml is applied to my linear layout…
squall leonhart
  • 301
  • 1
  • 5
  • 16
0
votes
1 answer

how to set rounded corners with background tansparency object in android shape xml

I m tying to get rounded corners with background color in shape xml file. But its not working with corners. Here is the output of the code And here is the code
Gavin
  • 321
  • 2
  • 10
0
votes
1 answer

How to update Android ShapeDrawable bounds changes after implementing Scroller with GestureDetector?

What I have Tried: I'm drawing shapeDrawables in onDraw(Canvas canvas) with specified the bounds. Added Handle Input Gestures which allow the view to scroll in any direction like 2d scroll view like mentioned in this SO post. Problem: when I scroll…
LOG_TAG
  • 19,894
  • 12
  • 72
  • 105
0
votes
1 answer

How to Draw Arrowline in android.graphics.Path with correct configerations

What I have Tried: I'm trying to display the arrow line with following code Path mArrowPath=new Paint();; mArrowPath.rewind(); mArrowPath.moveTo(0, mHeight / 2); mArrowPath.lineTo(mWidth / 2, 0); mArrowPath.lineTo(mWidth, mHeight /…
LOG_TAG
  • 19,894
  • 12
  • 72
  • 105
0
votes
3 answers

How to give layout rounded corners Android

I am trying to display an activity with a translucent background on top of another with a drawable in the center of the screen. The drawable has rounded corners, and I've set a rectangle shape with rounded corners as the background of the layout. …
0
votes
2 answers

creating colored stripes in android ListView

I am trying to create thin colored stripes in my app. This is similar to stripes of different color that we see in calendar apps. Is there any easy way to do it. What I am doing: I have a shape defined with width and height and I am trying to apply…
Bala Sivagnanam
  • 863
  • 1
  • 15
  • 30
0
votes
1 answer

Android :: set background fail from drawable resources

PROBLEM I have inflate some layout to add into the existing layout by using below code. Everything seem to be ok in API = 19 However, below 19 is not. I don't know what happen here please help me find problems thx. EXAMPLE IMAGE DEFAULT VIEW…
Jongz Puangput
  • 5,527
  • 10
  • 58
  • 96
0
votes
2 answers

Adding two colors as background without using gradient

I was trying to apply shadow effect for my views and find out that I could use gradient to do it. I created an XML file
P-RAD
  • 1,293
  • 2
  • 15
  • 36
0
votes
1 answer

Shapes with Navigation Drawer in android

I have implemented Navigation Drawer for my App. This works just fine. I am setting a counter for an item in the menu. Which would show a number. For which I am trying out the shapes (ring). I would like to show a circle with the number inside it.…
TheDevMan
  • 5,914
  • 12
  • 74
  • 144
0
votes
0 answers

Make ImageView or its parent circular from left side

I have a very basic layout as follows. I'm just using a red background in the ImageView just to depict the situation.
Pranav Mahajan
  • 2,048
  • 2
  • 23
  • 36
0
votes
1 answer

Create multiple rectangle shape in a xml file

I have create a shape.xml in android project. In this xml file i have a rectangle shape design with border.This is working fine. I need to create a another rectangle shape with left border in the same xml. Is this possible or not. If its possible…
user3085540
  • 275
  • 3
  • 12
  • 27
0
votes
2 answers

Android different textview with different rounded edges and colors background

I am using a large number of textviews across my android app. And I have a background.xml file with shape and color property of rounded edges. I set this background to my textview. If I have a few different colors as background, I can create…
Riny
  • 159
  • 1
  • 6
  • 17
0
votes
1 answer

Crop an Image/drawable to a triangle

I'm trying to crop an image to triangle in my Android App so that I only get the triangle portion of the image. How can this be done? I've successfully done the cropping for Square and Circle shapes but I'm unable to do the same for the triangle.…
1 2 3
12
13