我正在完成实现一个应用程序,其中有内部活动发送消息(只需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