KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I’m attempting to create a layout border with corners that are square on the outside and round on the inside. I’ve gathered that I need to create an .xml drawable definition composed of two shapes: one with a stroke width and corner radius and another with a stroke width only: The drawables round_border.xml <shape xmlns:android="http://schemas.android.com/apk/res/android"> <stroke android:width="4dp" android:color="#FF000000" /> <padding android:left="7dp" android:top="7dp" android:right="7dp" android:bottom="7dp" /> <corners android:radius="4dp" /> <solid android:color="#FFC0C0C0" /> </shape> square_border.xml <shape xmlns:android="http://schemas.android.com/apk/res/android"> <stroke android:width="2dp" android:color="#FF000000" /> <solid android:color="#FFC0C0C0" /> </shape> Each of these works independantly as a border when appliedby itself like so: android:background="@drawable/round_border" but when they either or both are added to an item-list drawable like so: composite_border.xml <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <layer-list> <item android:drawable="@drawable/round_border"/> <!-- <item android:drawable="@drawable/square_border"/> --> </layer-list> </shape> and: android:background="@drawable/composite_border" The layout's background is completely black instead of just a black border. Does anyone know how to make the layer list work for this task?
Tags (comma-separated)
Save Edits
Cancel