我正在完成實現一個應用程序,其中有內部活動發送消息(只需editText和兩個按鈕 - 發送和取消,消息然後發送到固定地址)。當我開始這個活動時,在屏幕上我看到文本框和鍵盤,它立即顯示。但是這樣做的缺點是這些按鈕被鍵盤覆蓋或半覆蓋,我想要的是與消息中的類似。當鍵盤可見時,縮小文本字段並在鍵盤上方的添加按鈕中顯示,如果我在屏幕下方回擊箭頭,則鍵盤消失,幾乎整個屏幕將由此editText拍攝,底部將出現這兩個按鈕...它是真的嗎?Android - editText和發送/退出按鈕
編輯:如何做到這一點,該屏幕將與主動鍵盤可見所有按鈕?
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:orientation="vertical"
android:layout_height="fill_parent"
android:background="@drawable/poz3"
android:padding="10dip">
<TextView
android:text="Message:"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="25dip"
android:textColor="@color/black"
/>
<EditText
android:id="@+id/message"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="Write message here"
android:gravity="top"
android:lines="7"
android:inputType="textShortMessage|textAutoCorrect|textCapSentences|textMultiLine"
android:imeOptions="actionSend|flagNoEnterAction"
/>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:orientation="horizontal"
android:layout_height="fill_parent"
>
<Button
android:id="@+id/enquirySendButton"
android:layout_width="fill_parent"
android:layout_height="60dip"
android:text="Send"
android:layout_weight="1.0"
android:background="@drawable/custom_button"
/>
<Button
android:id="@+id/enquiryExitButton"
android:layout_width="fill_parent"
android:layout_height="60dip"
android:text="Cancel"
android:layout_weight="1.0"
android:background="@drawable/custom_button"
/>
</LinearLayout>
</LinearLayout>
好友,請解釋您查詢正確。 – Mudassir
或這個鏈接可以幫助你http://developer.android.com/resources/articles/on-screen-inputs.html –
你可以請你發佈的XML? – ingsaurabh