Reputation: 7191
I have a layout where I have some parts of headers and list:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/bisque">
<LinearLayout
xmlns:treeView="http://schemas.android.com/apk/res/com.spot.p2a"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_toLeftOf="@+id/backArrow"
android:orientation="vertical"
android:weightSum="100"
android:background="@color/antiquewhite">
<LinearLayout
android:id="@+id/email_listview_top"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="20"
android:orientation="vertical"
android:background="@color/bisque" >
<TextView
android:id="@+id/email_listview_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pdf_mail_versand_text"
android:textColor="@color/black"
android:layout_marginTop="30dp"
android:layout_marginLeft="20dp"
android:textStyle="bold"
android:textSize="24dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="20dp"
android:orientation="vertical"
android:background="@color/antiquewhiter">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="5dp"
android:orientation="vertical"
android:background="@color/antiquewhite">
</LinearLayout>
<TextView
android:id="@+id/headList"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/datenblätter_text"
android:textColor="@color/black"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:textStyle="bold"
android:textSize="14dp" />
</LinearLayout>
</LinearLayout>
<pl.polidea.treeview.TreeViewList
android:id="@+id/tree"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="80"
android:background="@color/antiquewhiter"
treeView:indicator_gravity="right|center_vertical"
android:scrollbars="vertical"
android:smoothScrollbar="true"/>
<!-- <ListView -->
<!-- android:id="@android:id/list" -->
<!-- android:layout_width="match_parent" -->
<!-- android:layout_height="0dp" -->
<!-- android:layout_weight="80" -->
<!-- android:fadingEdge="none" -->
<!-- android:background="@color/antiquewhiter" -->
<!-- android:divider="@color/bisque" -->
<!-- android:dividerHeight="2dp" -->
<!-- android:visibility="gone" -->
<!-- > -->
<!-- </ListView> -->
</LinearLayout>
<ImageView
android:id="@+id/backArrow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:src="@drawable/back_android" />
</RelativeLayout>
when I show keyboard on phone this part:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="20dp"
android:orientation="vertical"
android:background="@color/antiquewhiter">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="5dp"
android:orientation="vertical"
android:background="@color/antiquewhite">
</LinearLayout>
<TextView
android:id="@+id/headList"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/datenblätter_text"
android:textColor="@color/black"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:textStyle="bold"
android:textSize="14dp" />
</LinearLayout>
</LinearLayout>
disapear. I don't know why. When I hide keyboard this part show again. If anyone has that problem please explain why some parts are hide when keyboard is showing on screen?
Upvotes: 1
Views: 1872
Reputation: 1761
Try this in your activity inside the “AndroidManifest” file.
<activity android:windowSoftInputMode="adjustResize|adjustPan">
For more take a look:-
https://developer.android.com/guide/topics/manifest/activity-element.html#wsoft
Upvotes: 4
Reputation: 7532
Read about Android windowSoftInputMode
So you can change the mode to “resize” at the following statement to your activity in “AndroidManifest”.
<activity android:name=".YourActivity"
android:windowSoftInputMode="adjustResize">
Upvotes: 1