开发者

Visual separator in RelativeView

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"
        andro开发者_开发技巧id: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>


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜