Android中的EditText

Android中的EditText,android,Android,我有edittext和edittext下面的一个按钮。 edittext的宽度为填充父项,高度为换行内容 “我的消息”覆盖全屏,因此“我的按钮”不可见,它隐藏在虚拟键盘下方 谁能解决这个问题。 谢谢 尝试在调用edittext的布局文件中插入以下内容: android:layout_above="@+id/ID OF YOUR BUTTON HERE" 此外,底部的按钮可能需要: android:layout_alignParentBottom="true" 尝试将其插入到调用edit

我有edittext和edittext下面的一个按钮。 edittext的宽度为填充父项,高度为换行内容

“我的消息”覆盖全屏,因此“我的按钮”不可见,它隐藏在虚拟键盘下方

谁能解决这个问题。 谢谢


尝试在调用edittext的布局文件中插入以下内容:

  android:layout_above="@+id/ID OF YOUR BUTTON HERE"
此外,底部的按钮可能需要:

android:layout_alignParentBottom="true"

尝试将其插入到调用edittext的布局文件中:

  android:layout_above="@+id/ID OF YOUR BUTTON HERE"
此外,底部的按钮可能需要:

android:layout_alignParentBottom="true"
假设您希望编辑文本覆盖除按钮外的所有屏幕

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <EditText
        android:id="@+id/myedittext"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_weight="1" />
    <Button
        android:id="@+id/mybutton"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="this is my button"/>
</LinearLayout>

假设您希望编辑文本覆盖除按钮外的所有屏幕

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <EditText
        android:id="@+id/myedittext"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_weight="1" />
    <Button
        android:id="@+id/mybutton"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="this is my button"/>
</LinearLayout>

我在与Andrew的解决方案相似但不完全相同的方面取得了最大的成功:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <EditText
        android:id="@+id/myedittext"
        android:layout_width="fill_parent"
        android:layout_height="0dp"
        android:layout_weight="1" />
    <Button
        android:id="@+id/mybutton"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_weight="0"
        android:text="this is my button"/>
</LinearLayout>

我在与Andrew的解决方案相似但不完全相同的方面取得了最大的成功:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <EditText
        android:id="@+id/myedittext"
        android:layout_width="fill_parent"
        android:layout_height="0dp"
        android:layout_weight="1" />
    <Button
        android:id="@+id/mybutton"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_weight="0"
        android:text="this is my button"/>
</LinearLayout>


你怎么知道他在使用
RelativeLayout
?你怎么知道他在使用
RelativeLayout
?代码在哪里?截图没用。代码在哪里?截图没用。安德鲁的解决方案有用吗?!我觉得你的好很多,但虚拟键盘呢?!“有效屏幕大小”将缩小以允许使用虚拟键盘,剩余空间将按照相同的布局进行安排。键盘会出现,按钮会占用空间,EditText会得到剩下的任何东西,这可能不多。听起来不错,我应该在周一试试:)Andrew的解决方案有效吗?!我觉得你的好很多,但虚拟键盘呢?!“有效屏幕大小”将缩小以允许使用虚拟键盘,剩余空间将按照相同的布局进行安排。键盘会显示出来,按钮会占用它的空间,EditText会得到剩下的任何东西,这可能不会太多。听起来不错,我应该在周一试试:)