我有一個EditText和一個LinearLayout中,但在輸入上的EditText膠囊包裹的按鈕,Android手機上的鍵盤,儘管指定Android鍵盤隱藏LinerLayout
this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
和
<activity
android:name=".postNavigator"
android:label="@string/title_activity_post_navigator"
android:windowSoftInputMode="adjustPan|adjustResize">
</activity>
的隱藏佈局
我的XML代碼
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.dailyspring.rejo.cpray.postNavigator">
<!--<ImageView-->
<!--android:layout_width="fill_parent"-->
<!--android:layout_height="fill_parent"-->
<!--android:scaleType="centerCrop"-->
<!--android:src="@drawable/back_blur" />-->
<LinearLayout android:orientation="vertical"
android:layout_width="match_parent"
android:weightSum="2"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="15sp"
android:layout_marginRight="15sp"
android:layout_marginTop="15sp"
android:layout_weight="1"
android:orientation="vertical"
android:weightSum="1">
<com.github.leonardoxh.customfont.FontText
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="10sp"
android:text="Post Title"
android:textAlignment="center"
android:textSize="25dp"
app:font="Roboto-Thin" />
<com.github.leonardoxh.customfont.FontText
android:id="@+id/authorName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="10sp"
android:text="Author"
android:textAlignment="center"
android:textSize="15dp"
app:font="Roboto-Thin" />
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<TextView
android:id="@+id/txtDesc"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="DescriptionDescription Description Description DescriptionDescription Description Description Description Description Descriptionescription sDescripti Description Description Description Description Description Description Descriptionescription sDescripti Description Description Description Description Description Description Description" />
</ScrollView>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:layout_weight="1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.5">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ProgressBar
android:layout_width="fill_parent"
android:layout_gravity="top"
android:layout_height="55dp"
android:id="@+id/loadingProgressBar"/>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1.3"
android:orientation="vertical"
android:layout_marginLeft="15sp"
android:layout_marginRight="15sp"
android:layout_marginTop="15sp">
<com.github.leonardoxh.customfont.FontText
android:id="@+id/commentTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginBottom="10sp"
android:text="Comments"
android:textAlignment="center"
android:textSize="15dp"
app:font="Roboto-Thin" />
<ListView
android:id="@+id/listcomments"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:divider="@null"
android:dividerHeight="0dp"
android:paddingBottom="10dp"
android:fadeScrollbars="false"
android:listSelector="@drawable/list_selector"
android:background="@drawable/rounded_corner_nobg"
android:transcriptMode="alwaysScroll"
android:stackFromBottom="true"/>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_marginBottom="15sp"
android:layout_marginLeft="15sp"
android:layout_marginRight="15sp"
android:layout_marginTop="15sp"
android:orientation="horizontal">
<EditText
android:id="@+id/commentText"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:paddingLeft="10dp"
android:background="@drawable/rounded_corner"
android:imeOptions="flagNoFullscreen"
android:hint=" add comment"
android:layout_weight="0.5"/>
<at.markushi.ui.CircleButton
android:layout_width="53dp"
android:layout_height="53dp"
android:id="@+id/pickImage"
android:src="@drawable/ic_send_white_48dp"
app:cb_color="#99CC00"
app:cb_pressedRingWidth="5dip" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
我試過調整android:layout_weight和調整邊距和填充,但沒有什麼幫助。我該如何解決這個問題?
你讀它 - http://stackoverflow.com/questions/17410499/difference-between-adjustresize-and-adjustpan-in-android? – Divers
是的。指定任何一個都沒有幫助。仍然隱藏佈局 –