/ / Cómo eliminar espacios entre cuadros de edición de texto - Android, diseño

Cómo eliminar espacios entre los cuadros editText - android, layout

Hola, tengo un LinearLayout dentro de FrameLayout,El diseño lineal contiene pocos campos de texto de edición, pero hay mucho espacio entre cada texto de edición. Quiero reducir el espacio entre cada campo de edición. Por favor ayuda

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>

diseño

Respuestas

2 para la respuesta № 1

Use el atributo android: paddingTop junto con la vista EditText con dps negativos.

Ejemplo:

    <EditText android:id="@+id/edit_fname" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:hint="First Name (Required)" android:paddingTop=-3dp />

En función de sus requisitos, puede aplicar a cualquiera de estos atributos. android: paddingLeft android: paddingRight android: paddingBottom android: paddingTop


2 para la respuesta № 2

usar márgenes negativos en lugar de relleno ...