I am using appcompat-v7 v21 and I have a problem with toolbar and rest of the layout in the activity.
The view looks fine in the portrait mode, but when turned to landscape, the views are going behind the Toolbar. Please refer to screenshots.
Portrait:
Landscape:
toolbar_without_spinner.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimaryDark"
android:elevation="4dp"
android:minHeight="?attr/actionBarSize"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" >
<TextView
android:id="@+id/toolbar_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textColor="@android:color/white"
android:textSize="20sp" />
</android.support.v7.widget.Toolbar>
activity_profile.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
android:orientation="vertical" >
<include
android:id="@+id/toolbar"
layout="@layout/toolbar_without_spinner" />
<ScrollView
android:id="@+id/scrollview"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="10dp"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/white"
android:orientation="horizontal"
android:padding="10dp" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginRight="20dp"
android:orientation="vertical" >
<ImageView
android:id="@+id/profile_imageview_profile_photo"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center_horizontal"
android:contentDescription="@string/empty"
android:src="@drawable/ic_thumbnail" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical" >
<EditText
android:id="@+id/profile_edittext_firstname"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="@string/signup_first_name"
android:inputType="textCapWords" >
</EditText>
<EditText
android:id="@+id/profile_edittext_lastname"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:ems="10"
android:hint="@string/signup_last_name"
android:inputType="textCapWords" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="300dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="top"
android:orientation="vertical"
android:padding="10dp" >
<TextView
android:id="@+id/profile_textview_display_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:text="@string/display_name_hint"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/profile_textview_email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/email_hint"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/profile_edittext_about"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:ems="10"
android:gravity="top|left"
android:hint="@string/profile_about"
android:inputType="textMultiLine"
android:lines="5"
android:maxLines="5"
android:minLines="3"
android:scrollbars="vertical" />
<EditText
android:id="@+id/profile_edittext_twitter_handle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:ems="10"
android:hint="@string/profile_twitter_hanle"
android:inputType="textCapWords" />
<EditText
android:id="@+id/profile_edittext_website"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:ems="10"
android:hint="@string/profile_website"
android:inputType="textCapWords" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal" >
<Button
android:id="@+id/profile_button_edit_cancel"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:layout_weight="0.50"
android:text="@string/profile_cancel" />
<Button
android:id="@+id/profile_button_edit_profile"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="0.50"
android:text="@string/profile_edit" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
Also, in portrait mode, if i try to enter text in any of the edittext, the views are going behind the toolbar.