我试图在两个EditText小部件之间添加一条水平线,但奇怪的是该行底部没有填充,因此它看起来"粘在"它下面的小部件.
这是我的代码(在layout.xml中,在具有垂直方向的LinearLayout内):
<EditText android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:capitalize="sentences"
android:singleLine="true"
android:maxLength="30" />
<View android:background="#FF00FF00"
android:layout_width="fill_parent"
android:layout_height="1dip" />
<EditText android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingTop="10dp"
android:scrollbars="vertical"
android:capitalize="none"
android:autoLink="all"
android:maxLines="8" />
Run Code Online (Sandbox Code Playgroud)
这就是它的样子:

我想在线下添加一些填充.我尝试在View小部件中使用android:paddingBottom,并在下面的EditText小部件中使用android:paddingTop,但结果是相同的(它被忽略).
而不是使用填充使用保证金.在xml中使用以下属性:
android:layout_marginTop="5dip"
android:layout_marginBottom="5dip"
Run Code Online (Sandbox Code Playgroud)
希望这能解决你的问题... :)
| 归档时间: |
|
| 查看次数: |
4356 次 |
| 最近记录: |