您好我有一个LinearLayout里面的FrameLayout,线性布局包含很少的edittext字段,但每个edittext之间有很大的空间,我想减少每个editfield之间的空间。请帮助如何删除编辑文本框之间的空格
XML
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:gravity="center">
<ImageView android:layout_width="fill_parent"
android:layout_height="fill_parent" android:src="@drawable/bg_reddotted"
android:scaleType="centerInside" />
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout_main" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:orientation="vertical"
android:layout_margin="0dp" android:padding="0dp">
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Almost done! Please verify your info and provide your mobile number"
android:singleLine="false" />
<EditText android:id="@+id/edit_fname" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:hint="First Name (Required)" />
<EditText android:id="@+id/edit_lname" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:hint="Surname Name (Required)" />
<EditText android:id="@+id/edit_email" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:hint="Email (Required)" />
<EditText android:id="@+id/edit_phone" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:hint="Mobile Number (Optional)" />
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content" android:text="“Sign Up”"
android:paddingBottom="10dp" android:gravity="center_horizontal"
android:paddingTop="10dp" />
<Button android:id="@+id/btn_signup" android:layout_width="100dp"
android:layout_height="wrap_content" android:text="Sign Up"
android:layout_gravity="center_horizontal" android:padding="12dp"
android:background="@drawable/btn_grey_square" />
</LinearLayout>
</FrameLayout>
我不知道UI元素可以在LinearLayout中重叠。如果他们不能,请改用RelativeLayout。 – Emiam
我不认为这会起作用,它不会接受负值。反正填充对负值不起作用。 – Urban