I Cant See Contents of the first few lines of my ListView when the keyboard is visible.
I spent the whole day trying out a different layout code, as well as my own, to fix this, and now I understand the problem a bit more to help someone help me solve it.
The problem is that if I point the height of the list (or its container) to fill_parent, then it makes android think that the bottom of the list (at the bottom of the screen) is the part displayed above the keyboard, although there is as yet no actual content to show it. For some reason I canβt take part in the competition before the start of my list. Specifying only the contents of the cover simply shows a small area in which the list should be indicated.
Here is my last layout code (all attempts create the same problem)
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/RelativeLayoutchat" > <LinearLayout android:orientation="horizontal" android:gravity ="clip_horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_centerInParent="true"> </LinearLayout> <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> <ListView android:id="@+id/MessagesListView" android:layout_width="fill_parent" android:layout_height="fill_parent" android:transcriptMode="alwaysScroll" android:divider="#000000" android:clickable="false" android:layout_weight="9" android:cacheColorHint="#00000000"/> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_weight="1" style="@android:style/ButtonBar" android:gravity="center" android:paddingLeft="3dip" android:paddingTop="3dip" android:paddingRight="3dip"> <EditText android:id="@+id/msgBox" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" android:maxLines="5" android:enabled="true" android:textSize="17sp" android:maxLength="150"/> <Button android:id="@+id/sendbutton" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_gravity="center" android:text="send" android:layout_weight="4"/> </LinearLayout> </LinearLayout> </RelativeLayout>
Any help really appreciated.
source share