I wanted to add a linear layout, having a transparent background as well as with white borders. The problem is: as far as I have googled, I can achieve only one out of both.
Here's what I did:
Saved the following as border.xml in drawable
<?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <shape android:shape="rectangle"> <solid android:color="#FFFFFF" /> </shape> </item> <item android:left="5dp" android:right="5dp" android:top="5dp" android:bottom="5dp" > <shape android:shape="rectangle"> </shape> </item> </layer-list>
my existing page layout
<LinearLayout android:id="@+id/quiz" android:layout_width="150dp" android:layout_height="120dp" android:background="#66041414" <-------- replaced it with android:background="@drawable/border" android:orientation="vertical" android:layout_marginLeft="5dp" > ...... </LinearLayout>
I am getting opaque background, when the border was included.
I wanted a final result to be like:
totally stuck with it. Just wanted to find a way out to achieve it. Any suggestions would be quite helpful.