I'm developing an App, and I need to draw borders and separators on a View, like the eBay app.
I think on a combination of shapes and view with 1dp. There is another easy way?
Many thanks.
Create a 9-patch image for the outside border. Use that as the background resource and it will give you the rounded corners with solid border. For dividers, you can create a simple view and have another background resource that's a simple image with the same color as the border in the 9-patch.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/roundedborder"
android:orientation="vertical">
<!-- Put Saved Searches display code here. Probably LinearLayout/horizonal -->
<TextView
android:layout_width="fill_parent"
android:layout_height="1dp"
android:background="@drawable/simpleborder"
android:layout_margin="3dp"/> <!-- Spacer! -->
<!-- Put Favorite sellers display code here. Probably LinearLayout/horizonal -->
</LinearLayout>
</LinearLayout>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With