2

Is there a way to create a visual divider in a relative layout similar to the way you can using a list divider?

This is what I have currently.

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">

 <TextView
        android:layout_height="wrap_content"
        android:text="Screen Ratio:"  
        android:id="@+id/ScreenRatio" 
        android:layout_width="100dip" 
        android:layout_alignTop="@+id/ratio_spinner" 
        android:layout_alignBottom="@+id/ratio_spinner" 
        android:gravity="center_vertical"/>


 <Spinner android:layout_width="fill_parent" 
  android:layout_height="wrap_content" 
  android:layout_toRightOf="@+id/ScreenRatio" 
  android:id="@+id/ratio_spinner"/>

 <TextView
        android:layout_height="wrap_content"
        android:text="Units:"  
        android:id="@+id/Units"
        android:layout_width="wrap_content" 
        android:layout_toLeftOf="@+id/unit_spinner"
        android:layout_alignTop="@+id/unit_spinner"
        android:layout_alignBottom="@+id/unit_spinner"
        android:gravity="center_vertical" 
        android:layout_alignParentLeft="true"/>

    <Spinner android:layout_width="fill_parent" 
 android:layout_height="wrap_content" 
 android:layout_toRightOf="@+id/ScreenRatio" 
 android:layout_below="@+id/ratio_spinner" 
 android:id="@+id/unit_spinner"/> 

     <Button
        android:layout_height="wrap_content"
        android:layout_width="wrap_content" 
        android:text="Clear" 
        android:layout_alignParentBottom="true" 
        android:layout_alignParentRight="true" 
        android:gravity="fill" 
        android:paddingLeft="50dip" 
        android:paddingRight="50dip"/>

</RelativeLayout>

1 Answer 1

2

So far , i have tried to add separator inside the TableLayout using the below code:

<View android:id="@+id/view_separator" 
 android:background="#FFFFFF" 
 android:layout_centerVertical ="true"
 android:layout_width = "fill_parent"
 android:layout_height="2dip"
 android:layout_alignParentTop="true"/>

It may helps you, just try it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.