【发布时间】:2018-09-25 07:20:54
【问题描述】:
我从一天开始就卡住了,我尝试了多种方法,但不是屏幕不是自动 我正在使用 parent="@style/Theme.AppCompat.Light.NoActionBar" 主题,但没有奏效。我在清单文件 I 中尝试了以下过程 添加如下
android:windowSoftInputMode="adjustResize"
我也添加了 FrameLayout 和 ScrollView 作为根布局和子布局 布局,但没有工作。
我在 xml 文件中的代码是
android:id="@+id/root_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:fitsSystemWindows="false">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<Button
android:id="@+id/forgot_screen_send_button"
android:layout_width="100dp"
android:layout_height="45dp"
android:layout_marginLeft="30sp"
android:layout_marginRight="30dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="20dp"
android:layout_gravity="center_horizontal"
android:background="@drawable/blue_color_bg_rec"
android:text="Send"
android:layout_alignParentBottom="true"
android:textColor="@color/white"
android:textAllCaps="false"
android:textSize="18sp"/>
</LinearLayout>
</LinearLayout>
【问题讨论】:
-
尝试将根RelativeLayout 设置为ScrollView,然后设置fitsSystemWindows="true" 并删除其中一个LinearLayouts。你不需要两者。
标签: android android-layout scrollview android-xml autoscroll