gpt4 book ai didi

android - adjustPan 推送我的布局并隐藏状态栏

转载 作者:太空狗 更新时间:2023-10-29 14:58:21 28 4
gpt4 key购买 nike

在 list 中使用 adjustPan 将我的布局推到顶部并使我的 UI 看起来很可笑。

这是我的 Android list :

<activity
android:name=".AddNote"
android:label="@string/title_activity_add_note"
android:windowSoftInputMode="stateVisible|adjustPan">

这是我的 XML 文件:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.dinosaur.cwfei.materialnotes.AddNote">

<include
android:id="@+id/app_bar"
layout="@layout/app_bar_no_spinner" />

<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="@dimen/cardview_margin">
<ScrollView
android:id="@+id/scroll_view"
android:layout_width="fill_parent"
android:layout_height="match_parent"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="@dimen/activity_vertical_margin"
android:orientation="vertical">

<EditText

android:id="@+id/editTextTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/margin_16"
android:background="@color/transparent"
android:hint="@string/hint_title"
android:textStyle="bold" />

<EditText

android:id="@+id/editTextDescription"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/transparent"
android:hint="@string/hint_note" />

<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginBottom="@dimen/margin_16"
android:layout_marginTop="100dp"
android:background="@color/divider_color" />

</LinearLayout>
</ScrollView>
</android.support.v7.widget.CardView>

</LinearLayout>

最佳答案

通过使用 adjustResize 而不是 adjustPan 解决了这个问题,设置 fitsSystemWindows="true"以防 adjustResize 不起作用。

关于android - adjustPan 推送我的布局并隐藏状态栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29384134/

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