gpt4 book ai didi

android - 当 Edittext 获得焦点时,软键盘按下底部操作栏

转载 作者:行者123 更新时间:2023-11-29 17:54:23 26 4
gpt4 key购买 nike

我正在使用

android:uiOptions="splitActionBarWhenNarrow"

用于底部操作栏。

还有这个

 android:windowSoftInputMode="adjustResize"

用于在出现软键盘时调整 View 。但问题是,当键盘打开时,底部操作栏会出现在键盘上,如图所示。即使键盘打开,我也希望它位于底部。如果我不使用“adjustResize”,它会保留在底部,但当键盘打开时,我的 View 不可滚动,我看不到整个 View 。我想要这两种方式意味着底部操作栏应保持在底部并且 View 应保持可滚动。

任何帮助将不胜感激。谢谢。

<?xml version="1.0" encoding="UTF-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:map="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/action_bar"
android:layout_alignParentTop="true" >

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".AddScreen" >

<View
android:layout_width="0dp"
android:layout_height="10dp" />

<EditText
android:id="@+id/add_et_task_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:nextFocusDown="@+id/add_et_task_remarks"
android:hint="Task Name" />

<EditText
android:id="@+id/add_et_task_remarks"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:hint="Remarks"
android:inputType="textMultiLine"
android:lines="3" />

<View
android:layout_width="0dp"
android:layout_height="10dp" />

<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="#b2b2b2" />


</LinearLayout>
</ScrollView>



</RelativeLayout>

enter image description here

enter image description here

最佳答案

如果是全屏,

然后就

代替这一行

@android:style/Theme.Holo.NoActionBar.FullScreen 在 menefesto

放这条线

@android:style/Theme.Holo.NoActionBar

我相信它会解决你的问题

放置

在 Activity 标签中放置 android:windowSoftInputMode="adjustPan"

谢谢,

萨尔

关于android - 当 Edittext 获得焦点时,软键盘按下底部操作栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20537049/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com