Content_mail.xml file does not open - android

The content_mail.xml file will not open. I am attempting to produce a ScrollView for the entire android screen for all views within. Code follows this is a revision of prior code posted:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
tools:context="com.cancunsteve.aboutcancunsteve.MainActivity"
tools:showIn="#layout/activity_main">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/scrollView"
android:layout_alignParentStart="true"
android:layout_marginTop="56dp" />
<ImageView android:id="#+id/imageView"
android:layout_column="1"
android:background="#mipmap/lpussy"
android:contentDescription='android:ContentDescription="#string/desc"'
tools:ignore="HardcodedText"
android:layout_width="200dp"
android:layout_height="230dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" We&apos;ve been serving good people like you since 1994 with special deals on their travel plans. "
android:id="#+id/text1"
android:layout_alignTop="#+id/imageView"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:background="#ffffff"
android:foreground="#05ffffff"
android:foregroundTint="#03ffffff"
android:textColor="#000000" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/editText2"
android:text="Cancun, Chichen Itza."
android:layout_below="#+id/text1"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/editText"
android:text="Holbox, Taxco, Palenque, Acapulco, Ixtapa, Guanajuato,
Cabo San Lucas, Puerto Vallarta, Monterrey, Tenacatita, Mascota"
android:layout_below="#+id/editText2"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/imageButton"
android:layout_below="#+id/editText3"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:background="#mipmap/campa"
tools:ignore="ContentDescription"
android:layout_alignBottom="#+id/editText5" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textEmailAddress"
android:ems="10"
android:id="#+id/editText3"
android:text="thewebmaster#cancunsteve.com"
android:layout_below="#+id/editText"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignRight="#+id/editText"
android:layout_alignEnd="#+id/editText" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="phone"
android:ems="10"
android:id="#+id/editText4"
android:text=" 011 52 998 8873919"
android:layout_below="#+id/editText3"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginLeft="42dp"
android:layout_marginStart="32dp" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/editText5"
android:text="be sure to visit us discounts on your hotel bookings"
android:layout_below="#+id/editText4"
android:layout_toRightOf="#+id/scrollView"
android:layout_toEndOf="#+id/scrollView" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="click buttons multiple times to change state"
android:id="#+id/textView2"
android:layout_below="#+id/imageButton" />
</RelativeLayout>
</ScrollView>
The above code incorporates changes suggested as I understood them or misunderstood them. One suggestion was to remove the images. But I require them.

Remove tools:showIn="#layout/activity_main" and replace the code with below code and also replace cloasing tag </RelativeLayout> with </LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_marginTop="56dp"
android:orientation="vertical">
<ImageView
android:id="#+id/imageView"
android:layout_width="200dp"
android:layout_height="230dp"
android:layout_column="1"
android:background="#mipmap/ic_launcher"
android:contentDescription='android:ContentDescription="#string/desc"'
tools:ignore="HardcodedText" />
<TextView
android:id="#+id/text1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignTop="#+id/imageView"
android:background="#ffffff"
android:foreground="#05ffffff"
android:foregroundTint="#03ffffff"
android:text="We&apos;ve been serving good people like you since 1994 with special deals on their travel plans. "
android:textColor="#000000" />
<EditText
android:id="#+id/editText2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_below="#+id/text1"
android:text="Cancun, Chichen Itza." />
<EditText
android:id="#+id/editText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/editText2"
android:text="Holbox, Taxco, Palenque, Acapulco, Ixtapa, Guanajuato,
Cabo San Lucas, Puerto Vallarta, Monterrey, Tenacatita, Mascota" />
<ImageButton
android:id="#+id/imageButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/editText5"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/editText3"
android:background="#mipmap/ic_launcher"
tools:ignore="ContentDescription" />
<EditText
android:id="#+id/editText3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignEnd="#+id/editText"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignRight="#+id/editText"
android:layout_below="#+id/editText"
android:ems="10"
android:inputType="textEmailAddress"
android:text="thewebmaster#cancunsteve.com" />
<EditText
android:id="#+id/editText4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/editText3"
android:layout_marginLeft="42dp"
android:layout_marginStart="32dp"
android:ems="10"
android:inputType="phone"
android:text="011 52 998 8873919" />
<EditText
android:id="#+id/editText5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/editText4"
android:text="be sure to visit us discounts on your hotel bookings" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/imageButton"
android:text="click buttons multiple times to change state" />
</LinearLayout>
</ScrollView>

Related

this content_main.xml file does not scroll

The following file is intended to allow full vertical scrolling in Android devices.
However when opening the app in Android Studio the light blue rectangular box ends just before where the buttons begin. Does not scroll. Members of Stack Overflow have helped me to overcome the file not opening. I thank them. But issue of scrolling remains.
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
tools:context="com.cancunsteve.aboutcancunsteve.MainActivity"
tools:showIn="#layout/activity_main">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
<RelativeLayout
android:id="#+id/scrollView"
android:layout_alignParentStart="true"
android:layout_marginTop="56dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<ImageView android:id="#+id/imageView"
android:layout_column="1"
android:background="#mipmap/lpussy"
android:contentDescription='android:ContentDescription="#string/desc"'
tools:ignore="HardcodedText"
android:layout_width="200dp"
android:layout_height="230dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" We&apos;ve been ... "
android:id="#+id/text1"
android:layout_alignTop="#+id/imageView"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:background="#ffffff"
android:foreground="#05ffffff"
android:foregroundTint="#03ffffff"
android:textColor="#000000" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/editText2"
android:text="Cancun, Playa del Carmen, ..."
android:layout_below="#+id/text1"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/editText"
android:text="Holbox, ..."
android:layout_below="#+id/editText2"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/imageButton"
android:layout_below="#+id/editText3"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:background="#mipmap/campa"
tools:ignore="ContentDescription"
android:layout_alignBottom="#+id/editText5" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textEmailAddress"
android:ems="10"
android:id="#+id/editText3"
android:text="thewebmaster#cancunsteve.com"
android:layout_below="#+id/editText"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignRight="#+id/editText"
android:layout_alignEnd="#+id/editText" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="phone"
android:ems="10"
android:id="#+id/editText4"
android:text=" 011 52 998 8873919"
android:layout_below="#+id/editText3"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginLeft="42dp"
android:layout_marginStart="32dp" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/editText5"
android:text="be sure ..."
android:layout_below="#+id/editText4"
android:layout_toRightOf="#+id/ScrollView"
android:layout_toEndOf="#+id/ScrollView" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="click buttons multiple times to change state"
android:id="#+id/textView2"
android:layout_below="#+id/imageButton" />
</RelativeLayout>
</ScrollView>

Buttons in layout are crammed to left side of screen

I have two buttons (Next and Cancel) in my layout that are crammed to the left side of the screen and it won't allow me to adjust them past the centre. I tried playing around with the attributes of the buttons to fix it, I even considered placing these buttons in a linear layout in order to organize them with no luck.
I've attached my .xml file, I would really appreciate it if someone can point out where I'm going wrong.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin">
<EditText
android:id="#+id/emailAddress"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textEmailAddress"
android:text="Email"
android:layout_marginTop="79dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" />
<EditText
android:id="#+id/mobileNum"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:text="Mobile"
android:layout_alignParentStart="true"
android:layout_below="#+id/emailAddress"
android:layout_centerHorizontal="true" />
<EditText
android:id="#+id/password"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="text"
android:text="Password"
android:layout_alignParentStart="true"
android:layout_below="#+id/mobileNum"
android:layout_centerHorizontal="true" />
<RadioGroup
android:id="#+id/radioGroup"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_marginTop="23dp"
android:layout_below="#+id/password"
android:layout_above="#+id/loginButton"
android:layout_alignEnd="#+id/password">
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Rider"
android:id="#+id/riderRadioButton"
android:layout_alignTop="#+id/driverRadioButton"
android:layout_toEndOf="#+id/driverRadioButton"
android:layout_alignBottom="#+id/driverRadioButton"
android:checked="false"
android:onClick="onRadioButtonClicked" />
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Driver"
android:id="#+id/driverRadioButton"
android:layout_centerVertical="true"
android:layout_alignParentStart="true"
android:checked="false"
android:onClick="onRadioButtonClicked" />
</RadioGroup>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Your email and number are used to send you ride confirmations"
android:id="#+id/messageTextView"
android:layout_below="#+id/password"
android:layout_centerHorizontal="true"
android:layout_marginTop="79dp"
android:textAlignment="center"
android:textSize="13dp"/>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_below="#+id/messageTextView">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Next"
android:id="#+id/nextButton"
android:layout_marginTop="35dp"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Cancel"
android:id="#+id/cancelButton"
android:layout_marginEnd="85dp"/>
</LinearLayout>
At the time, I didn't have experience with xml files. However, I have been able to fix it now. I removed the LinearLayout which contained the buttons, and played around with some attributes to get it to work.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
tools:context="daniaghazal.com.hitchhikr.SignUpPage">
<EditText
android:id="#+id/emailAddress"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textEmailAddress"
android:hint="Email"
android:layout_marginTop="79dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" />
<EditText
android:id="#+id/mobileNum"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:hint="Mobile"
android:layout_alignParentStart="true"
android:layout_below="#+id/emailAddress"
android:layout_centerHorizontal="true" />
<EditText
android:id="#+id/password"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:hint="Password"
android:layout_alignParentStart="true"
android:layout_below="#+id/mobileNum"
android:layout_centerHorizontal="true" />
<RadioGroup
android:id="#+id/radioGroup"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_marginTop="23dp"
android:layout_below="#+id/password"
android:checkedButton="#+id/riderRadioButton"
android:layout_alignBottom="#+id/messageTextView"
android:layout_alignParentEnd="true">
<RadioButton
android:id="#+id/riderRadioButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Rider"
android:layout_alignTop="#+id/driverRadioButton"
android:layout_toEndOf="#+id/driverRadioButton"
android:layout_alignBottom="#+id/driverRadioButton"
android:checked="false"
android:onClick="onRadioButtonClicked" />
<RadioButton
android:id="#+id/driverRadioButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Driver"
android:layout_centerVertical="true"
android:layout_alignParentStart="true"
android:checked="false"
android:onClick="onRadioButtonClicked" />
</RadioGroup>
<TextView
android:id="#+id/messageTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Your email and number are used to send you ride confirmations"
android:layout_below="#+id/password"
android:layout_centerHorizontal="true"
android:layout_marginTop="79dp"
android:textAlignment="center"
android:textSize="13dp"/>
<Button
android:id="#+id/nextButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Next"
android:layout_marginLeft="75dp"
android:layout_marginTop="20dp"
android:layout_below="#+id/messageTextView"
android:layout_alignParentStart="true" />
<Button
android:id="#+id/cancelButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Cancel"
android:layout_marginTop="20dp"
android:layout_below="#+id/radioGroup"
android:layout_toEndOf="#+id/nextButton" />
</RelativeLayout>
Try to set android:gravity attribute of parent layout to center it's content. Something like:
EDIT
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin">
<EditText
android:id="#+id/emailAddress"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textEmailAddress"
android:text="Email"
android:layout_marginTop="79dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"/>
<EditText
android:id="#+id/mobileNum"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:text="Mobile"
android:layout_alignParentStart="true"
android:layout_below="#+id/emailAddress"
android:layout_centerHorizontal="true"/>
<EditText
android:id="#+id/password"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="text"
android:text="Password"
android:layout_alignParentStart="true"
android:layout_below="#+id/mobileNum"
android:layout_centerHorizontal="true"/>
<RadioGroup
android:id="#+id/radioGroup"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_marginTop="23dp"
android:layout_below="#+id/password"
android:checkedButton="#+id/riderRadioButton"
android:layout_alignBottom="#+id/messageTextView"
android:layout_alignParentEnd="true">
<RadioButton
android:id="#+id/riderRadioButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Rider"
android:layout_alignTop="#+id/driverRadioButton"
android:layout_toEndOf="#+id/driverRadioButton"
android:layout_alignBottom="#+id/driverRadioButton"
android:checked="false"
android:onClick="onRadioButtonClicked"/>
<RadioButton
android:id="#+id/driverRadioButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Driver"
android:layout_centerVertical="true"
android:layout_alignParentStart="true"
android:checked="false"
android:onClick="onRadioButtonClicked"/>
</RadioGroup>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Your email and number are used to send you ride confirmations"
android:id="#+id/messageTextView"
android:layout_below="#+id/password"
android:layout_centerHorizontal="true"
android:layout_marginTop="79dp"
android:textAlignment="center"
android:textSize="13dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/messageTextView"
android:layout_marginTop="20dp"
android:gravity="center_horizontal">
<Button
android:id="#+id/nextButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Next"/>
<Button
android:id="#+id/cancelButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Cancel"/>
</LinearLayout>
</RelativeLayout>

Rendering Problems in Android Studio 2.2.3

Every time I add widgets or stuff, below exception always occurs, so I can't even run my project. What causes this problem? What is the solution? I'm very new to Android Studio, and I hope you guys will help me. Every answer of you will be my pleasure. Thanks!
Here is my Layout.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
tools:context="com.example.leeroyld.testproject.MainActivity">
<Button
android:text="#string/LoginButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/button"
android:layout_marginBottom="79dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:background="#android:color/background_dark"
android:backgroundTint="#android:drawable/bottom_bar"
android:textColor="#android:color/background_light" />
<TextView
android:text="#string/LoginLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/EmailDisplay"
android:textSize="24sp"
android:layout_below="#+id/textView"
android:layout_alignParentStart="true"
android:layout_marginTop="36dp" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:ems="10"
android:id="#+id/PasswordInput"
tools:ignore="LabelFor"
android:layout_marginBottom="42dp"
android:layout_above="#+id/button"
android:layout_centerHorizontal="true"
android:background="?attr/actionModeBackground" />
<TextView
android:text="#string/PasswordLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/PasswordDisplay"
android:textSize="24sp"
android:layout_centerVertical="true"
android:layout_alignParentStart="true" />
<TextView
android:text="#string/TextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/textView"
android:textSize="24sp"
android:layout_marginTop="31dp"
android:background="#android:drawable/button_onoff_indicator_on"
android:backgroundTint="#android:drawable/alert_light_frame"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textEmailAddress"
android:ems="10"
android:id="#+id/EmailInput"
tools:ignore="LabelFor"
android:layout_marginTop="24dp"
android:background="?attr/actionModeBackground"
android:layout_below="#+id/EmailDisplay"
android:layout_alignStart="#+id/PasswordInput" />
</RelativeLayout>
Remove the android:backgroundTint from LoginButton and TextView. Your final layout should look like this.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin">
<Button
android:id="#+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="79dp"
android:background="#android:color/background_dark"
android:text="Login"
android:textColor="#android:color/background_light" />
<TextView
android:id="#+id/EmailDisplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/textView"
android:layout_marginTop="36dp"
android:text="Email"
android:textSize="24sp" />
<EditText
android:id="#+id/PasswordInput"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/button"
android:layout_centerHorizontal="true"
android:layout_marginBottom="42dp"
android:background="?attr/actionModeBackground"
android:ems="10"
android:inputType="textPassword"
tools:ignore="LabelFor" />
<TextView
android:id="#+id/PasswordDisplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="Password"
android:textSize="24sp" />
<TextView
android:id="#+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="31dp"
android:background="#android:drawable/button_onoff_indicator_on"
android:text="TextView"
android:textSize="24sp" />
<EditText
android:id="#+id/EmailInput"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/EmailDisplay"
android:layout_marginTop="24dp"
android:background="?attr/actionModeBackground"
android:ems="10"
android:inputType="textEmailAddress"
tools:ignore="LabelFor" />
</RelativeLayout>

XLM design is not reflecting after run android studio

My XML Preview design before executing android studio.
After Executing android studio design is showing old design, I changed EditText name but still showing the same name and also added new button that also not reflecting after run my android app.
Below is my XML design:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
tools:context="com.cnkonline.demo2.MainActivity"
tools:showIn="#layout/activity_main">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Email"
android:id="#+id/textView"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true"
android:layout_marginTop="55dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Password"
android:id="#+id/textView2"
android:layout_below="#+id/textView"
android:layout_alignParentStart="true"
android:layout_marginTop="42dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Mobile"
android:id="#+id/textView3"
android:layout_below="#+id/textView2"
android:layout_alignParentStart="true"
android:layout_marginTop="42dp" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Submit"
android:id="#+id/button"
android:layout_toEndOf="#+id/textView2"
android:layout_marginTop="77dp"
android:layout_alignTop="#+id/textView3" />
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/editText"
android:layout_gravity="center"
android:layout_below="#+id/textView"
android:layout_centerHorizontal="true" />
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/editText2"
android:layout_gravity="center"
android:layout_below="#+id/textView2"
android:layout_alignParentStart="true" />
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/editText3"
android:layout_gravity="center"
android:layout_below="#+id/textView3"
android:layout_alignParentStart="true" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Login"
android:id="#+id/button2"
android:layout_below="#+id/button"
android:layout_alignEnd="#+id/button" />

RelativeLayout in ScrollView Error

I'm trying to make a form that has many textView and editText controls so I tried using scrollview because the screen won't be able to display all of them.
But when I added to a certain set of textview and scrollview, the next one appears on the top side of the screen instead of below the previous set.
Below is my xml, Please help!
XML FILE :
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
tools:context=".InsertJob" >
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="358dp"
android:orientation="vertical" >
<TextView
android:id="#+id/JobNameTV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:text="#string/name" />
<EditText
android:id="#+id/JobNameET"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/JobNameTV"
android:layout_alignBottom="#+id/JobNameTV"
android:layout_marginLeft="70dp"
android:layout_marginRight="20dp"
android:layout_toRightOf="#+id/JobNameTV"
android:ems="10"
android:inputType="textPersonName" />
<TextView
android:id="#+id/JobDateTV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/JobNameTV"
android:layout_below="#+id/JobNameET"
android:layout_marginTop="25dp"
android:text="#string/date" />
<EditText
android:id="#+id/JobDateET"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/JobDateTV"
android:layout_alignBottom="#+id/JobDateTV"
android:layout_alignLeft="#+id/JobNameET"
android:layout_marginRight="20dp"
android:ems="10"
android:hint="#string/date_example"
android:inputType="date" >
<requestFocus />
</EditText>
<TextView
android:id="#+id/JobTimeStartTV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/JobDateTV"
android:layout_below="#+id/JobDateTV"
android:layout_marginTop="25dp"
android:text="Jam Mulai" />
<EditText
android:id="#+id/JobTimeStartET"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/JobTimeStartTV"
android:layout_alignBottom="#+id/JobTimeStartTV"
android:layout_alignLeft="#+id/JobDateET"
android:layout_marginRight="20dp"
android:ems="10"
android:hint="#string/timeexample"
android:inputType="time" />
<TextView
android:id="#+id/JobTimeEndTV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/JobDateTV"
android:layout_below="#+id/JobTimeStartTV"
android:layout_marginTop="25dp"
android:text="Jam Selesai" />
<EditText
android:id="#+id/JobTimeEndET"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/JobTimeEndTV"
android:layout_alignBottom="#+id/JobTimeEndTV"
android:layout_alignLeft="#+id/JobDateET"
android:layout_marginRight="20dp"
android:ems="10"
android:hint="#string/timeexample"
android:inputType="time" />
<TextView
android:id="#+id/JobPlaceTV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/JobTimeEndTV"
android:layout_below="#+id/JobTimeEndET"
android:layout_marginTop="25dp"
android:text="#string/place" />
<EditText
android:id="#+id/JobPlaceET"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/JobPlaceTV"
android:layout_alignBottom="#+id/JobPlaceTV"
android:layout_alignLeft="#+id/JobTimeEndET"
android:layout_marginRight="20dp"
android:ems="10"
android:inputType="text" />
<TextView
android:id="#+id/JobDetailTV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/JobPlaceTV"
android:layout_below="#+id/JobPlaceET"
android:layout_marginTop="40dp"
android:text="Detail" />
<EditText
android:id="#+id/JobDetailET"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/JobPlaceET"
android:layout_alignBaseline="#+id/JobDetailTV"
android:layout_marginRight="20dp"
android:ems="10"
android:inputType="textMultiLine" />
<TextView
android:id="#+id/SongListTV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/JobDetailTV"
android:layout_below="#+id/JobDetailET"
android:layout_marginTop="20dp"
android:text="Lagu 1" />
<EditText
android:id="#+id/SongListET"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/JobDetailET"
android:layout_alignBaseline="#+id/SongListTV"
android:ems="10"
android:inputType="text" />
</RelativeLayout>
</ScrollView>
<Button
android:id="#+id/LogoutBtn"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="20dp"
android:layout_marginRight="20dp"
android:background="#drawable/logout"
android:onClick="logout" />
<Button
android:id="#+id/ConfirmBtn"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_alignBottom="#+id/LogoutBtn"
android:layout_marginLeft="20dp"
android:background="#drawable/confirm" />
</RelativeLayout>
// Try this way,hope this will help you to solve your problem.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
tools:context=".InsertJob" >
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="358dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="20dp">
<TextView
android:id="#+id/JobNameTV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:text="#string/name" />
<EditText
android:id="#+id/JobNameET"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#id/JobNameTV"
android:layout_marginLeft="70dp"
android:layout_toRightOf="#id/JobNameTV"
android:ems="10"
android:inputType="textPersonName" />
<TextView
android:id="#+id/JobDateTV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/JobNameET"
android:layout_marginTop="25dp"
android:text="#string/date" />
<EditText
android:id="#+id/JobDateET"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#id/JobNameET"
android:layout_alignBaseline="#id/JobDateTV"
android:layout_toRightOf="#id/JobDateTV"
android:ems="10"
android:hint="#string/date_example"
android:inputType="date" >
</EditText>
<TextView
android:id="#+id/JobTimeStartTV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/JobDateTV"
android:layout_marginTop="25dp"
android:text="Jam Mulai" />
<EditText
android:id="#+id/JobTimeStartET"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#id/JobDateET"
android:layout_alignBaseline="#id/JobTimeStartTV"
android:layout_toRightOf="#id/JobTimeStartTV"
android:ems="10"
android:hint="#string/timeexample"
android:inputType="time" />
<TextView
android:id="#+id/JobTimeEndTV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/JobTimeStartTV"
android:layout_marginTop="25dp"
android:text="Jam Selesai" />
<EditText
android:id="#+id/JobTimeEndET"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#id/JobTimeStartET"
android:layout_alignBaseline="#id/JobTimeEndTV"
android:layout_toRightOf="#id/JobTimeEndTV"
android:ems="10"
android:hint="#string/timeexample"
android:inputType="time" />
<TextView
android:id="#+id/JobPlaceTV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/JobTimeEndTV"
android:layout_marginTop="25dp"
android:text="#string/place" />
<EditText
android:id="#+id/JobPlaceET"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#id/JobTimeEndET"
android:layout_alignBaseline="#id/JobPlaceTV"
android:layout_toRightOf="#id/JobPlaceTV"
android:ems="10"
android:inputType="text" />
<TextView
android:id="#+id/JobDetailTV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/JobPlaceTV"
android:layout_marginTop="40dp"
android:text="Detail" />
<EditText
android:id="#+id/JobDetailET"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#id/JobPlaceET"
android:layout_alignBaseline="#id/JobDetailTV"
android:layout_toRightOf="#id/JobDetailTV"
android:ems="10"
android:inputType="textMultiLine" />
<TextView
android:id="#+id/SongListTV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/JobDetailTV"
android:layout_marginTop="20dp"
android:text="Lagu 1" />
<EditText
android:id="#+id/SongListET"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#id/JobDetailET"
android:layout_alignBaseline="#id/SongListTV"
android:layout_toRightOf="#id/SongListTV"
android:ems="10"
android:inputType="text" />
</RelativeLayout>
</ScrollView>
<Button
android:id="#+id/LogoutBtn"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="20dp"
android:layout_marginRight="20dp"
android:background="#drawable/logout"
android:onClick="logout" />
<Button
android:id="#+id/ConfirmBtn"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_alignBottom="#+id/LogoutBtn"
android:layout_marginLeft="20dp"
android:background="#drawable/confirm" />
</RelativeLayout>
EditText JobDateET is missing attribute "android:layout_layout_below="#+id/JobDateTV"
EditText JobTimeStartET is missing attribute "android:layout_layout_below="#+id/JobTimeStartTV"
EditText JobTimeStartET is missing attribute "android:layout_layout_below="#+id/JobTimeStartTV"
Try this.......
<TextView
android:id="#+id/SongListTV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/JobDetailTV"
android:layout_marginTop="20dp"
android:text="Lagu 1"/>

Categories

Resources