How to add border around linear layout except at the bottom ? LinearLayout needs to have border at left, top and right side but not at the bottom.
Create an XML file named border.xml in the drawable folder and put the following code in it.
-
-
Then add a background to your linear layout like this:
android:background="@drawable/border"
EDIT :
This XML was tested with a galaxy s running GingerBread 2.3.3 and ran perfectly as shown in image below:
ALSO
tested with galaxy s 3 running JellyBean 4.1.2 and ran perfectly as shown in image below :
Finally its works perfectly with all APIs
EDIT 2 :
It can also be done using a stroke to keep the background as transparent while still keeping a border except at the bottom with the following code.
-
hope this help .