Reputation: 3714
I have the following divider and I wanted do the same effect but in vertical. How could I do this?
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:bottom="2dp">
<shape android:shape="rectangle">
<gradient
android:startColor="#0fffffff"
android:centerColor="#ff696969"
android:endColor="#0fffffff"
android:angle="90"></gradient>
<size android:height="2dp"></size>
</shape>
</item>
<item android:top="2dp">
<shape android:shape="rectangle">
<solid android:color="#ffffff"></solid>
<size android:height="1dp"></size>
</shape>
</item>
</layer-list>
I get the solution with the help of Celta, I didnt use the divider xml and build my own lLinearLayout:
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<View
android:layout_width="1dp"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:background="#ff696969"></View>
<View
android:layout_width="2dp"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:background="#ffffff"></View>
</LinearLayout>
Upvotes: 6
Views: 17709
Reputation: 3620
You can use a View
Horizontal:
<View
android:layout_width="fill_parent"
android:layout_height="1dp"
android:background="@android:color/holo_blue_light" />
Vertical:
<View
android:layout_width="1dp"
android:layout_height="fill_parent"
android:background="@android:color/holo_blue_light" />
Upvotes: 33