<FrameLayout android:layout_width="match_parent" android:layout_height="match_parent"> ** <RelativeLayout android:layout_width="match_parent" android:layout_height="50dp" />** <ListView android:id="@+id/list_collection" android:layout_width="match_parent" android:layout_height="match_parent"/> </FrameLayout> </LinearLayout>
太字にしたところが今回追加したところなんですが、これだと「RelativeLayout」と「ListView」が被って表示されてしまいます。
そこで、RelativeLayoutを50dpで一番上に表示して、その下にくっつく形でListViewを表示する時は、どうかけばいいんでしょうか?
ご教授のほどよろしくお願いいたします。
<追記>
今回タブの実現方法がまったく持って違っていました…。
できましたら、TabHostを使いたいと思っています。
既存のXMLをどうTabHostに入れ込めばいいかご教授いただきたいです。
よろしくお願いします。
<追記>
<?xml version="1.0" encoding="utf-8"?> <LinearLayout 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:id="@+id/root" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:fitsSystemWindows="true" tools:context="com.xxxxx.xxxxxxx.activity.xxxxxxActivity"> <android.support.design.widget.AppBarLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/AppTheme.AppBarOverlay"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary" app:popupTheme="@style/AppTheme.PopupOverlay"/> </android.support.design.widget.AppBarLayout> <FrameLayout android:layout_width="match_parent" android:layout_height="match_parent"> <ListView android:id="@+id/list_collection" android:layout_width="match_parent" android:layout_height="match_parent"/> </FrameLayout> </LinearLayout>
<追記>
<?xml version="1.0" encoding="utf-8"?> <LinearLayout 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:id="@+id/root" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:fitsSystemWindows="true" tools:context="com.xxxxx.xxxxxxx.activity.xxxxxxActivity"> <android.support.design.widget.AppBarLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/AppTheme.AppBarOverlay"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary" app:popupTheme="@style/AppTheme.PopupOverlay"/> </android.support.design.widget.AppBarLayout> <TabHost android:layout_width="match_parent" android:layout_height="match_parent"> </TabHost> <FrameLayout android:layout_width="match_parent" android:layout_height="match_parent"> <ListView android:id="@+id/list_collection" android:layout_width="match_parent" android:layout_height="match_parent"/> </FrameLayout> </LinearLayout>
<TabHost android:layout_width="match_parent" android:layout_height="match_parent" android:id="@android:id/tabcontent" android:layout_alignParentTop="true" android:layout_alignParentStart="true"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <TabWidget android:id="@android:id/tabs" android:layout_width="match_parent" android:layout_height="wrap_content" ></TabWidget> <FrameLayout android:layout_width="match_parent" android:layout_height="match_parent"> <ListView android:id="@+id/list_collection" android:layout_width="match_parent" android:layout_height="match_parent"/> </FrameLayout> </LinearLayout> </TabHost> </LinearLayout>
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/10/05 04:20
2016/10/05 04:32
2016/10/05 04:36
2016/10/05 04:40
2016/10/05 04:48
2016/10/05 04:52
2016/10/05 04:55
2016/10/05 05:29
2016/10/05 05:37
2016/10/05 05:50
2016/10/05 06:00
2016/10/05 06:11
2016/10/05 06:53
2016/10/05 07:09
2016/10/05 07:47