0
我正試圖在軟鍵盤加載時調整我的屏幕。正常的屏幕看起來像這樣。 軟鍵盤發行
但是,當用戶單擊EditText時,視圖會中斷並出現如下所示。在我的清單的活動我加入以下機器人:windowSoftInputMode =「adjustResize」
我想什麼發生的是,無論是在底部的按鈕出現,且整個EDITTEXT沒有被切割可見當用戶點擊EditText時。
編輯:將以下行添加到我的活動getWindow()。setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);使我的視圖看起來像這樣。但我還是希望我的兩個按鈕出現在EditText上
XML爲底部的EditText底部和按鈕
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1.6 "
android:background="#FFFFFF"
android:orientation="vertical">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1">
<EditText
android:hint="Enter your Message"
android:ems="10"
android:id="@+id/messageET"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1">
<RelativeLayout
android:background="@drawable/lightrectangle"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="2.5">
<ImageButton
android:id="@+id/addimgbtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:background="#f6f6f6"
android:paddingLeft="10dp"
android:src="@mipmap/blueadd" />
<TextView
android:paddingLeft="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="Add an image"
android:id="@+id/textView4"
android:layout_centerVertical="true"
android:layout_toRightOf="@+id/addimgbtn"
/>
</RelativeLayout>
<RelativeLayout
android:background="@drawable/lightrectangle"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="2.5">
<ImageButton
android:id="@+id/sendbtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:paddingLeft="10dp"
android:layout_weight="2.5"
android:background="#f6f6f6"
android:src="@mipmap/bluesend" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="Send Message"
android:id="@+id/sendmsgTV"
android:layout_centerVertical="true"
android:layout_toRightOf="@+id/sendbtn"
android:paddingLeft="10dp"
/>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
你將有權發佈至少佈局的一個簡化版本。調整大小是你想要的,但需要有一個實際上可以調整大小的視圖。 –
@GabeSechan我需要調整什麼? – revipod
該中央清單需要收縮。 –