にシフトしているあなたはその結果...レイアウトが右
を見ることができるようToolbar
の内側に配置されていますLinearLayout
が右にシフトされ、Toolbar
は(TabHost
とよく積み重ねていませんそれは親Fragment
にToolbar
で再び実装される)。
- どうすれば修正できますか?
レイアウトスケッチ(アンドロイドスタジオ)
実際のアプリ
レイアウトコード
<LinearLayout 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:orientation="vertical"
tools:context="com.android.example">
<android.support.v7.widget.RecyclerView
android:id="@+id/recview_navigator"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="2dp"
android:layout_weight="1"/>
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:backgroundTint="@color/accent">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar_navigator"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:id="@+id/imageView_navigator_up"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_weight="1"
android:src="@drawable/ic_navigate_before_white_48dp"
android:tint="@color/recview"/>
<ImageView
android:id="@+id/imageView_navigator_save"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_weight="1"
android:src="@drawable/ic_save_white_48dp"
android:tint="@color/recview"/>
</LinearLayout>
</android.support.v7.widget.Toolbar>
</android.support.design.widget.AppBarLayout>
</LinearLayout>
もしあなたが 'AppBarLayout'や' Toolbar'を使わないなら、それらをレイアウトから削除してください。 –