I am having a strange issue in android. I have a LinearLayout below a ListView. The list view has a 0dp width and a layout_weight of 90. linear layout layout_weight is 10. and height 0dp. At device the linearlayout disappear.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ListView android:id="@+id/chatsListView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="90"
android:divider="@null"
android:dividerHeight="0dp"
android:listSelector="@android:color/transparent"
android:transcriptMode="alwaysScroll"
/>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="10"
android:padding="10dp">
<EditText
android:id="@+id/messageEditText"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:inputType="textMultiLine"
android:hint="type message here"
android:ems="10"/>
<ImageButton
android:id="@+id/sendMessageButton"
android:layout_width="50dp"
android:layout_height="50dp"
android:background="@drawable/send_button"/>
</LinearLayout>
</LinearLayout>
I need to know what it is the problem above, I do not want to do it in another way. I am doing this project to learn logically, and not copy paste.
Here preview at designer:
Here is preview in device:
When I open and close keyboard, it resize like in designer. I need to know if there is any error on the code.
Edit: Zharf from android-dev IRC found this solution:
Viewpager is being pushed out of the screen [CoordinatorLayout] [Design Library]