0

I'm trying to set a shape defined in XML as view's background. Here's it:

<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
    android:startColor="#fcfcfc"
    android:endColor="#cfcfcf"
    android:angle="270" />
<padding
    android:left="10dp"
    android:top="10dp"
    android:right="10dp"
    android:bottom="10dp" />
<stroke
    android:width="3dp"
    android:color="#aaaaaa">
</stroke>
<corners
    android:radius="1dp" />
</shape>

Although I've defined padding in the shape when I set it as a background to layout shape's edge completely match view's edge. Is it possible to make shape not to fill entire view?

Thanks

1 Answer 1

1

maybe you can use <item> ,like this:

<item android:top="95dp" >
 <shape >
    ....
  </shape>
</item>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.