I have 3 layouts, in the first I add content programmatically, the secound one I add content programmatically and put it on bottom, the third one I put fragments. The problem is in bottom layout, if I set the height to 40dp the fragment is displayed. But if I set it to wrap_content the fragment is not displayed…
<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"
tools:context=".MainActivity" >
<RelativeLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true" />
<RelativeLayout
android:id="@+id/acts"
android:layout_width="match_parent"
//android:layout_height="wrap_content" <-id/frame not show
android:layout_height="40dp" <-id/frame show
android:layout_alignParentBottom="true" />
<FrameLayout
android:id="@+id/frame"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/tabs"
android:layout_above="@id/acts" />
</RelativeLayout>
I have fix it, just add the acts layout to bottom of fragment and now its work fine. Tanks for your help.