Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/232.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android TableRow布局中的垂直线_Android_Android Layout - Fatal编程技术网

Android TableRow布局中的垂直线

Android TableRow布局中的垂直线,android,android-layout,Android,Android Layout,我想在Android布局中的TextView和EditText之间添加一个分隔符行。我曾经尝试过这样做,但当我使用时,我喜欢它 <TableRow android:id="@+id/frmPaymentTrRemainder" style="@style/rounded_row" > <TextView android:id=

我想在Android布局中的
TextView
EditText
之间添加一个分隔符行。我曾经尝试过这样做,但当我使用时,我喜欢它

         <TableRow
                android:id="@+id/frmPaymentTrRemainder"
                style="@style/rounded_row" >
                <TextView
                    android:id="@+id/frmPaymentTvRemainder"
                    style="@style/rounded_label"
                    android:text="Field" />
                <EditText
                    android:id="@+id/frmPaymentEtRemainder"
                    style="@style/rounded_value"
                    android:editable="false"
                    android:ems="10"
                    android:inputType="numberDecimal" />
                <View
                    android:layout_width="2dip"
                    android:layout_height="fill_parent"
                    android:layout_margin="6dp"
                    android:layout_weight="0.1"
                    android:background="#FF909090" />
            </TableRow>

当我在文本视图之间放置视图时,如

         <TableRow
                android:id="@+id/frmPaymentTrRemainder"
                style="@style/rounded_row" >

                <TextView
                    android:id="@+id/frmPaymentTvRemainder"
                    style="@style/rounded_label"
                    android:text="Field" />

                <View
                    android:layout_width="2dip"
                    android:layout_height="fill_parent"
                    android:layout_margin="6dp"
                    android:layout_weight="0.1"
                    android:background="#FF909090" />

                <EditText
                    android:id="@+id/frmPaymentEtRemainder"
                    style="@style/rounded_value"
                    android:editable="false"
                    android:ems="10"
                    android:inputType="numberDecimal" />
            </TableRow>


我只想在TextView和EditText之间有一个2pix分隔符。如果您能帮助完成此挑战,我们将不胜感激。

请尝试删除权重属性

尝试以下操作:


尝试在EditText之后移动分隔器视图,或将EditText和视图包裹在线性布局中,并相应地将权重设置为1和0

<LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
        >
       <View
                android:layout_width="2dip"
                android:layout_height="fill_parent"
                android:layout_margin="6dp"
                android:layout_weight="0"
                android:background="#FF909090" />

    <EditText
            android:id="@+id/frmPaymentEtRemainder"
            style="@style/rounded_value"
            android:editable="false"
            android:ems="10"
            android:layout_weight="1"
            android:inputType="numberDecimal" />


    </LinearLayout>


no。。我只是尝试了一下,删除了textview和view的权重,没有任何改变。我不确定你想做什么。。在描述中,你说你有两个文本视图,但在你的代码中只有一个。我只想在文本视图和编辑文本之间有一个2pix分隔符。@Rotem给出了正确的回答。只需将视图移到编辑文本之前。我在你的描述中遗漏了这一部分