【发布时间】:2016-01-01 22:04:32
【问题描述】:
由于我是 android 新手,我正在编写一个应用程序,在我的布局文件中,我在屏幕底部有一个编辑文本和两个按钮,如下所示:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_alignParentBottom="true"
android:orientation="vertical"
android:layout_gravity="bottom">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_weight="1"
android:orientation="horizontal">
<EditText
android:id="@+id/composeMessageBody"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_weight="1"
android:background="@android:color/white"
android:hint="@string/message_hint"
android:textColor="@android:color/black"
android:textSize="18dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_weight="1"
android:orientation="horizontal">
<Button
android:id="@+id/Button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:layout_weight="1"
android:background="@drawable/button_style_left" />
<Button
android:id="@+id/Button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:layout_weight="1"
android:background="@drawable/button_style_right" />
</LinearLayout>
当用户点击编辑文本时,键盘出现在绿色按钮上方,我的操作栏和屏幕上方的部分也消失或消失了。这是我的问题:我怎样才能拥有下图所示的状态?
在这张图片中,发送按钮和编辑文本都在一行中,对我来说是两行。谢谢你们。
【问题讨论】:
标签: android android-layout autocompletetextview