相关疑难解决方法(0)

Android当软键盘可见时,如何在全屏模式下调整布局

当软键盘处于活动状态并且我已成功实现它时,我已经研究了很多调整布局但是当我android:theme="@android:style/Theme.NoTitleBar.Fullscreen"在清单文件中的活动标签中使用它时问题就出现了.

为此,我使用android:windowSoftInputMode="adjustPan|adjustResize|stateHidden"了不同的选项,但没有运气.

之后,我以FullScreen编程方式实现并尝试了各种布局,FullScreen但都是徒劳的.

我引用了这些链接,并在此处查看了许多与此问题相关的帖子:

http://android-developers.blogspot.com/2009/04/updating-applications-for-on-screen.html

http://davidwparker.com/2011/08/30/android-how-to-float-a-row-above-keyboard/

这是xml代码:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:id="@+id/masterContainerView"
    android:layout_width="fill_parent" android:layout_height="fill_parent"
    android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android"
    android:background="#ffffff">

    <ScrollView android:id="@+id/parentScrollView"
        android:layout_width="fill_parent" android:layout_height="wrap_content">

        <LinearLayout android:layout_width="fill_parent"
            android:layout_height="fill_parent" android:orientation="vertical">

            <TextView android:id="@+id/setup_txt" android:layout_width="wrap_content"
                android:layout_height="wrap_content" android:text="Setup - Step 1 of 3"
                android:textColor="@color/top_header_txt_color" android:textSize="20dp"
                android:padding="8dp" android:gravity="center_horizontal" />

            <TextView android:id="@+id/txt_header" android:layout_width="fill_parent"
                android:layout_height="40dp" android:text="AutoReply:"
                android:textColor="@color/top_header_txt_color" android:textSize="14dp"
                android:textStyle="bold" android:padding="10dp"
                android:layout_below="@+id/setup_txt" />

            <EditText android:id="@+id/edit_message"
                android:layout_width="fill_parent" android:layout_height="wrap_content"
                android:text="Some text here." android:textSize="16dp"
                android:textColor="@color/setting_editmsg_color" android:padding="10dp"
                android:minLines="5" android:maxLines="6" android:layout_below="@+id/txt_header"
                android:gravity="top" android:scrollbars="vertical"
                android:maxLength="132" />

            <ImageView android:id="@+id/image_bottom"
                android:layout_width="fill_parent" android:layout_height="wrap_content" …
Run Code Online (Sandbox Code Playgroud)

android android-widget android-layout android-softkeyboard

170
推荐指数
13
解决办法
13万
查看次数

软键盘出现时如何调整布局

我想在软键盘激活时调整/重新调整布局大小,如下所示:

之前和之后:

在此输入图像描述在此输入图像描述


在SO中找到了几个资源:

  1. 如何在显示软键盘时保持所有字段和文本可见
  2. android软键盘出现时会破坏布局
  3. 软键盘打开时调整布局

但问题和答案相当模糊,这里的问题是我想要的更清晰的画面.

要求:

  • 它应该适用于任何屏幕尺寸的手机.
  • 注意到"FACEBOOK"和"注册Facebook"的保证金/填充空间在之前和之后都发生了变化.
  • 不涉及滚动视图.

android android-layout android-softkeyboard

147
推荐指数
8
解决办法
14万
查看次数