Что у меня есть:Android: RelativeLayout внутри FrameLayout, ширина высота ошибка
activity_comics.xml
- расположение контейнера для двух фрагментов: список (view_comicses.xml комиксов) и подробно комиксы просмотра
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:id="@+id/comics_fragment_container">
</FrameLayout>
view_comicses.xml
- фрагмент с шахматным ListView
<com.agimind.widget.huewu.pla.lib.MultiColumnListView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:pla="http://schemas.android.com/apk/res-auto"
android:id="@+id/multicollist"
android:layout_width="match_parent"
android:layout_height="match_parent"
pla:plaColumnNumber="2"
pla:plaLandscapeColumnNumber="3">
</com.agimind.widget.huewu.pla.lib.MultiColumnListView>
view_comics_detail.xml
- фрагмент для детального зрения комиксов
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/black">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/comics_image"
android:layout_centerInParent="true" />
</RelativeLayout>
После view_comicses.xml
и view_comics_detail.xml
фрагменты добавлены в activity_comics.xml
, в результате чего макет должен быть таким:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:id="@+id/comics_fragment_container">
<com.agimind.widget.huewu.pla.lib.MultiColumnListView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:pla="http://schemas.android.com/apk/res-auto"
android:id="@+id/multicollist"
android:layout_width="match_parent"
android:layout_height="match_parent"
pla:plaColumnNumber="2"
pla:plaLandscapeColumnNumber="3">
</com.agimind.widget.huewu.pla.lib.MultiColumnListView>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/black">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/comics_image"
android:layout_centerInParent="true" />
</RelativeLayout>
</FrameLayout>
Но по некоторым причинам в результате макет выглядеть следующим образом
ширины и высоты из RelativeLayout
равны match_parent, но при рендеринге как равный wrap_content. Почему это происходит? Я пробовал разностные параметры для FrameLayout
и RelativeLayout
, но не работает, любая помощь будет принята с благодарностью!