У меня проблема... Я хочу создать 2 FrameLayouts друг под другом, поэтому я попробовал этот код:
<?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:layout_width = "match_parent"
android:layout_height = "match_parent"
android:background = "#071c3f">
<FrameLayout
android:id = "@+id/ActionBarContainer"
android:layout_width = "match_parent"
android:layout_height = "75dp"/>
<FrameLayout
android:id = "@+id/LayoutContainer"
android:layout_width = "match_parent"
android:layout_height = "wrap_content" />
</LinearLayout>
Теперь отображается первый FrameLayout, но второй FrameLayout не виден на экране.
Что я делаю неправильно???





Значение по умолчанию android:orientation равно горизонтальный. Поэтому, если вы установите android:layout_width = "match_parent", вы не увидите второй FrameLayout по горизонтали.
I want to create 2 FrameLayouts below each other
Добавьте android:orientation = "vertical" будет работать:
<?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:layout_width = "match_parent"
android:layout_height = "match_parent"
android:background = "#374233"
android:orientation = "vertical">
<FrameLayout
android:id = "@+id/ActionBarContainer"
android:layout_width = "match_parent"
android:layout_height = "75dp"
>
</FrameLayout>
<FrameLayout
android:id = "@+id/LayoutContainer"
android:layout_width = "match_parent"
android:layout_height = "wrap_content">
</FrameLayout>
</LinearLayout>