1

I have a multiline EditText for recieving a query.

It looks like this

So far I have used the stroke but it isnt the same.

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

<item>
     <shape android:shape="rectangle" >
         <gradient
            android:angle="180"
            android:centerColor="@color/white"
            android:endColor="@color/white"
            android:gradientRadius="360"
            android:startColor="@color/white"
            android:type="sweep" />

    <stroke
        android:width="0.5dp"
        android:color="@color/light_gray" />
  </shape>
</item>
<item
       android:bottom="2dp"
       android:left="3dp"
       android:right="2dp"
       android:top="2dp">
        <shape android:shape="rectangle" >
              <solid android:color="@color/white" />
        </shape>
</item>

</layer-list>

what i achieved

enter image description here

The only thing missing is the gradient on all the sides of the corner.

I have referred few links here, here.

Anyone know the answer. Help. Thanks in advance.

Community
  • 1
  • 1
Arnold Laishram
  • 1,801
  • 2
  • 18
  • 25

1 Answers1

1

You are using gradient,but all with white color,

 <gradient
            android:angle="180"
            android:centerColor="@color/red"
            android:endColor="@color/blue"
            android:gradientRadius="360"
            android:startColor="@color/white"
            android:type="sweep" />

Make start, end and center color different and have a try.I didn't try it but it will work.

tiny sunlight
  • 6,231
  • 3
  • 21
  • 42
Silvans Solanki
  • 1,267
  • 1
  • 14
  • 27
  • no it doesnt work. the gradient doesnt come. the gradient should be with gray and white color only. just like in the image i wanted. and @android:color/white is different from @color/white(custom #FAFAFA) – Arnold Laishram Mar 18 '16 at 13:50
  • Did my answer show gradient or not? If it does show gradient then I have answered your question. Now about creating gradient in gray color you need to put another question over here or you need to try by your own. – Silvans Solanki Mar 18 '16 at 13:54
  • 1
    no it doesnt show. I have asked the question properly. I told i was missing the gradient on all the four sides. it should appear just like the inner shadow. – Arnold Laishram Mar 18 '16 at 13:56
  • @ArnoldLaishram did you achieved that? – AkshayT Mar 08 '20 at 03:25