ListViewとFragment(DrawerLayoutを含む)を含むアクティビティを1つ作った。DrawerLayout on Fragment Hide ListView
Activity.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:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ddffff"
>
<ListView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/lista"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true" />
<fragment
android:id="@+id/fragment1"
android:name=".Fragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>
リストビューが表示されません。私はリストビューが断片のために隠されていると思う。どうしてか分かりません。
リストビューとフラグメントの両方がフルスクリーンで表示されます。フラグメントが上にあるので、リストビューをカバーします。どのようにリストビューとフラグメントを画面上に配置したいのですか? – Francesc
私は、リストビューをdrawerlayoutの後ろに置いて欲しいです。このように:http://blog.teamtreehouse.com/wp-content/uploads/2015/02/nav_drawer_final.gif – tomss