0

In the following code:

<ScrollView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        xmlns:android="http://schemas.android.com/apk/res/android">

    <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:paddingLeft="16dp"
            android:paddingRight="16dp"
            android:orientation="vertical">

        <TextView
                android:layout_marginTop="20dp"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textSize="27sp"
                android:text="@string/create_card_text"/>

        <TextView
                android:layout_marginTop="20dp"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textSize="24sp"
                android:textColor="#ff949494"
                android:text="@string/create_card_info_text_one"/>

        <EditText
                android:id="@+id/name"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="40dp"
                android:hint="Name"/>

        <EditText
                android:id="@+id/email"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="20dp"
                android:inputType="textEmailAddress"
                android:hint="Email"/>

        <TextView
                android:id="@+id/phone_number"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:textSize="20sp"
                android:layout_marginLeft="10dp"
                android:layout_marginTop="20dp"
                android:hint="Phone Number"/>

        <Button
                android:id="@+id/next_button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="20dp"
                android:layout_marginLeft="280dp"
                android:text="@string/create_card_next_button"
                android:onClick="next"/>

    </LinearLayout>

</ScrollView>

The button just does not shows up. What could be wrong?

2
  • 2
    Your marginleft is huuuuge! Commented Feb 24, 2014 at 18:23
  • @K_K try below code and let me know whether it is working or not. Commented Feb 24, 2014 at 18:29

1 Answer 1

1

Try like this.

You have set android:layout_marginLeft="280dp" so replace this with

android:layout_marginLeft="20dp" or something else

so basically your button's code will look something like this

<Button
     android:id="@+id/next_button"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:layout_marginTop="20dp"
     android:layout_marginLeft="20dp"
     android:text="@string/create_card_next_button"
     android:onClick="next"/>

I think you have set margin left to 280dp which is causing problem and making it out of your screen set it to 20dp or as per your screen requirement as you have set other and it should work.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.