Seema
Seema

Reputation: 77

Edittext layout issue

Screen shotWhen i am scrolling through screen , all the text field in that screen shows half text only.. i tried a lot by adjusting size but not getting what is the problem.. can anyone explain me??

Here is my code

 <ScrollView
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:scrollbars="vertical" >

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:paddingTop="20dip" >

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="50dip"
            android:layout_marginRight="50dip"
            android:layout_marginTop="10dip"
            android:background="@drawable/inputtext_background" >

            <EditText
                android:id="@+id/edit_signup_fname_id"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:layout_marginBottom="10dip"
                android:layout_marginLeft="15dip"
                android:layout_marginRight="15dip"
                android:layout_marginTop="10dip"
                android:hint="@string/firstname_hint"
                android:singleLine="true" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="50dip"
            android:layout_marginRight="50dip"
            android:layout_marginTop="10dip"
            android:background="@drawable/inputtext_background" >

            <EditText
                android:id="@+id/edit_signup_email_id"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:layout_marginBottom="10dip"
                android:layout_marginLeft="15dip"
                android:layout_marginRight="15dip"
                android:layout_marginTop="10dip"
                android:hint="@string/emailid_hint"
                android:singleLine="true" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="50dip"
            android:layout_marginRight="50dip"
            android:layout_marginTop="10dip"
            android:background="@drawable/inputtext_background" >

            <EditText
                android:id="@+id/edit_signup_familyname_id"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:layout_marginBottom="10dip"
                android:layout_marginLeft="15dip"
                android:layout_marginRight="15dip"
                android:layout_marginTop="10dip"
                android:hint="@string/familyname_hint"
                android:singleLine="true" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="50dip"
            android:layout_marginRight="50dip"
            android:layout_marginTop="10dip"
            android:background="@drawable/inputtext_background"
            android:singleLine="true" >

            <EditText
                android:id="@+id/edit_signup_familyemail_id"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:layout_marginBottom="10dip"
                android:layout_marginLeft="15dip"
                android:layout_marginRight="15dip"
                android:layout_marginTop="10dip"
                android:hint="@string/familyemail_hint"
                android:singleLine="true" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="50dip"
            android:layout_marginRight="50dip"
            android:layout_marginTop="10dip"
            android:background="@drawable/inputtext_background" >

            <EditText
                android:id="@+id/edit_signup_password_id"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:layout_marginBottom="10dip"
                android:layout_marginLeft="15dip"
                android:layout_marginRight="15dip"
                android:layout_marginTop="10dip"
                android:hint="@string/password_hint"
                android:inputType="textPassword"
                android:singleLine="true" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="50dip"
            android:layout_marginRight="50dip"
            android:layout_marginTop="10dip"
            android:background="@drawable/inputtext_background" >

            <EditText
                android:id="@+id/edit_signup_retype_id"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:layout_marginBottom="10dip"
                android:layout_marginLeft="15dip"
                android:layout_marginRight="15dip"
                android:layout_marginTop="10dip"
                android:hint="@string/retype_hint"
                android:inputType="textPassword"
                android:singleLine="true" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="30dip"
            android:gravity="center_horizontal" >

            <Button
                android:id="@+id/btn_signup_sign_id"
                android:layout_width="150dip"
                android:layout_height="wrap_content"
                android:layout_marginLeft="20dip"
                android:background="@drawable/btn_sign_bg"
                android:text="@string/sign_up"
                android:textColor="#FFFFFF"
                android:textSize="20dip" />
        </LinearLayout>

        <TextView
            android:layout_width="fill_parent"
            android:layout_height="200dp" />
    </LinearLayout>
</ScrollView>

Upvotes: 3

Views: 381

Answers (1)

Manoj Kumar
Manoj Kumar

Reputation: 1520

Give margin on either the linear layout or the Edittext. Not on both. The marginTop is cutting the edittext's space

Upvotes: 1

Related Questions