Android 软键盘上推布局或隐藏操作栏

Android 软键盘上推布局或隐藏操作栏,android,android-layout,android-softkeyboard,Android,Android Layout,Android Softkeyboard,我的项目中的软键盘有问题。我已经将清单文件设置为 android:windowSoftInputMode="adjustPan" 这样我的键盘和编辑文本就可以看到了。但就像下面链接的问题一样,屏幕底部的按钮和键盘一起向上推 我的布局由两个线性布局(一个顶部,一个底部带有按钮)和一个位于中间的滚动视图组成,滚动视图获取其余内容。当我尝试设置选项时 android:isScrollContainer="false" 在我的ScrollView上,这次我的操作栏向上推,从布局中隐藏 我想一种方

我的项目中的软键盘有问题。我已经将清单文件设置为

android:windowSoftInputMode="adjustPan"
这样我的键盘和编辑文本就可以看到了。但就像下面链接的问题一样,屏幕底部的按钮和键盘一起向上推

我的布局由两个线性布局(一个顶部,一个底部带有按钮)和一个位于中间的滚动视图组成,滚动视图获取其余内容。当我尝试设置选项时

android:isScrollContainer="false" 
在我的ScrollView上,这次我的操作栏向上推,从布局中隐藏

我想一种方法,键盘得到超过底部线性布局滚动滚动的内容,滚动视图,而不是推上行动栏

有什么建议吗

谢谢大家!

顺便说一下,我的滚动视图有很多微调器、编辑文本和自动提示

工作“解决方案”-->帮助找到答案

如果我将RelativeLayout更改为LinearLayout with vertical orientation,并从清单中删除此属性android:WindowsOfInputMode=“adjustPan”,我会得到想要的效果,操作栏不会消失,底部按钮不会向上推。问题是,我输了底部按钮被堆叠在底部。有时ScrollView比设备窗口小,所以这个解决方案只是帮助了我,但现在解决了我真正的问题

资料:

<activity
   android:name=".app.HomeActivity"
   android:label="@string/title_activity_home"
   android:launchMode="singleTop"
   android:screenOrientation="portrait"
   android:windowSoftInputMode="adjustPan"/>

申请主题:

<style name="CustomActionBarTheme" parent="@style/AppTheme">
    <item name="android:actionBarStyle">@style/MyActionBar</item>
</style>

<!-- ActionBar styles -->
<style name="MyActionBar" parent="@android:style/Widget.Holo.ActionBar">
    <item name="android:background">@drawable/shape_bar</item>
    <item name="android:titleTextStyle">@style/MyActionBarTitleText</item>
</style>

@样式/MyActionBar
@可拉拔/成型杆
@样式/MyActionBartitletText
XML:



在你的清单中试试这个:
安卓:WindowsOfInputMode=“adjustResize | stateHidden”
安卓:WindowsOfInputMode=“adjustNothing”试试这个

回答这个问题可能已经晚了,但我面对了它,找到了一个解决方案,所以想到分享它

交出财产

android:isScrollContainer=“false”
Layout


android:WindowsOfInputMode=“adjustResize”对于
AndroidManifest.xml中的
活动
您是否设法解决了它?请尝试此android:WindowsOfInputMode=“stateHidden | stateUnchanged | adjustPan”。这次让我知道,actionbar被隐藏了,但没有按下按钮。与设置android:windowSoftInputMode=“adjustPan”确定问题描述的效果相同,顺便说一句,我也在使用片段。(不知道这是否重要)将android:WindowsOfInputMode=“adjustPan”更改为android:WindowsOfInputMode=“stateHidden | stateUnchanged | adjustPan”。您是否编写了删除操作栏的代码?=/已尝试将操作栏隐藏在布局中,但键盘忽略了底部按钮。我没有编写代码来删除动作bari有一个相当复杂的布局,在嵌套的滚动视图中有一个底部带有项目约束的约束布局,它会将工具栏向上推,除非我添加了大量的空白底部,但只是添加了安卓:isScrollContainer=“true”修复了它,非常感谢
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:id="@+id/fragment_detalhes_pedido2_linear_top"
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingTop="@dimen/activity_vertical_margin"
            android:paddingBottom="@dimen/activity_vertical_margin"
            android:paddingLeft="@dimen/activity_horizontal_margin"
            android:paddingRight="@dimen/activity_horizontal_margin"
            android:background="@color/font_white_color"
            android:orientation="horizontal"
            android:gravity="center_vertical">

            <ImageView
                android:layout_width="@dimen/icon_size_default"
                android:layout_height="@dimen/icon_size_default"
                android:layout_gravity="center_vertical"
                android:contentDescription="@string/app_name"
                android:src="@drawable/icon_lista_clientes" />

            <br.newm.afvcore.layout.NewmTextView
                android:id="@+id/fragment_detalhes_pedido2_txt_cliente"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="@dimen/activity_horizontal_margin"
                android:text="Cliente Selecionado"
                android:textColor="@color/font_default_color"
                android:textSize="@dimen/font_size_default"
                android:textStyle="bold|italic" />
        </LinearLayout>

        <View
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:background="#696969" />

    </LinearLayout>

    <ScrollView
        android:id="@+id/fragment_scroll_datalhes2_miolo"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_above="@+id/fragment_detalhes_pedido2_linear_bottom"
        android:layout_below="@+id/fragment_detalhes_pedido2_linear_top"></ScrollView>

    <LinearLayout
        android:id="@+id/fragment_detalhes_pedido2_linear_bottom"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_marginBottom="@dimen/activity_vertical_margin"
        android:orientation="vertical">

        <View
            android:layout_width="match_parent"
            android:layout_height="0.1dp"
            android:background="@color/cinza_linha" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/activity_vertical_margin"
            android:paddingLeft="@dimen/activity_horizontal_margin"
            android:paddingRight="@dimen/activity_horizontal_margin"
            android:orientation="horizontal"
            android:weightSum="1">

            <LinearLayout
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight="0.35">

                <br.newm.afvcore.layout.NewmTextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:textColor="@color/azul_letras"
                    android:textSize="@dimen/font_size_default"
                    android:text="Qtd:"
                    android:textStyle="bold" />

                <br.newm.afvcore.layout.NewmTextView
                    android:id="@+id/fragment_detalhes_pedido2_txt_qtd"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:textColor="@color/font_default_color"
                    android:textSize="@dimen/font_size_default"
                    android:text="999999999"
                    android:layout_marginLeft="5dp"
                    android:textStyle="bold" />
            </LinearLayout>

            <LinearLayout
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight="0.65"
                android:layout_marginLeft="5dp"
                android:gravity="right">

                <br.newm.afvcore.layout.NewmTextView
                    android:id="@+id/fragment_detalhes_pedido2_lbl_valor_total"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:textColor="@color/azul_letras"
                    android:textSize="@dimen/font_size_default"
                    android:text="Total:"
                    android:textStyle="bold" />

                <br.newm.afvcore.layout.NewmTextView
                    android:id="@+id/fragment_detalhes_pedido2_txt_valor_total"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:textColor="@color/font_default_color"
                    android:textSize="@dimen/font_size_default"
                    android:text="R$ 9.999.999,00"
                    android:layout_marginLeft="5dp"
                    android:textStyle="bold" />

            </LinearLayout>
        </LinearLayout>

        <LinearLayout
            android:id="@+id/fragment_detalhes_pedido2_linear_btn"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/activity_vertical_margin"
            android:paddingLeft="@dimen/activity_horizontal_margin"
            android:paddingRight="@dimen/activity_horizontal_margin"
            android:gravity="center_vertical">

            <Button
                android:id="@+id/fragment_detalhes_pedido2_btn_salvar"
                android:layout_width="0dip"
                android:layout_height="@dimen/btn_size_default"
                android:layout_weight="1"
                android:text="Salvar"
                android:background="@drawable/shape_btn_azul"
                android:textColor="@color/font_white_color"
                android:textSize="@dimen/font_size_default"
                android:textStyle="bold|italic" />

            <Button
                android:id="@+id/fragment_detalhes_pedido2_btn_reenviar_copia"
                android:layout_width="0dip"
                android:layout_height="@dimen/btn_size_default"
                android:layout_weight="1"
                android:text="Reenviar cópia do pedido"
                android:background="@drawable/shape_btn_azul"
                android:textColor="@color/font_white_color"
                android:textSize="@dimen/font_size_default"
                android:textStyle="bold|italic"
                android:visibility="gone" />

            <Button
                android:id="@+id/fragment_detalhes_pedido2_btn_finalizar"
                android:layout_width="0dip"
                android:layout_height="@dimen/btn_size_default"
                android:layout_marginLeft="@dimen/activity_horizontal_margin"
                android:layout_weight="1"
                android:text="Finalizar"
                android:background="@drawable/shape_btn_azul"
                android:textColor="@color/font_white_color"
                android:textSize="@dimen/font_size_default"
                android:textStyle="bold|italic" />

        </LinearLayout>

    </LinearLayout>

</RelativeLayout>