There is a layout:
<?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:background="@android:color/white"> <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_horizontal"> <ImageView android:id="@+id/view1" android:layout_width="match_parent" android:layout_height="wrap_content" android:adjustViewBounds="true" android:src="@drawable/image"/> <LinearLayout android:id="@+id/parent_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_alignBottom="@+id/view1" android:layout_alignTop="@+id/view1" android:orientation="horizontal" android:background="@android:color/holo_blue_light"> <View android:id="@+id/view2" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1"/> <TextView android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:text="Текст" android:textColor="@android:color/background_dark" android:gravity="center" android:textSize="40sp" android:background="@android:color/holo_green_light"/> </LinearLayout> <View android:id="@+id/view3" android:layout_width="match_parent" android:layout_height="2000dp" /> </RelativeLayout> </ScrollView>
I'm testing on the Genymotion emulator. On Nexus 7 4.4.4 800x1200, no text is displayed. On all other devices all good. Why is that?
UPD
Updated layout. It is also noticeable if view2 specifies android: layout_height = "match_parent", the text is displayed, but it does not take up the entire space of the parent layout, but only how much it needs.
UPD2
Updated layout. The height of view1 is not known in advance.