方向更改后,ScrollView不会滚动

时间:2013-03-17 05:32:10

标签: android android-fragments

我的布局如下:

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/ScrollView01"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

    <RelativeLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@color/Black"
        android:focusable="true"
        android:focusableInTouchMode="true" >

我正在使用片段,当我旋转设备时,滚动不起作用,但屏幕顶部的按钮仍然有效。

我让活动重新开始改变方向,我只是根据传递给片段的参数重新填充所有元素。

在我的onCreateView我有这个片段:

if (getArguments() != null) {
    String s = getArguments().getString("bookId");

这允许我重新填充我的所有元素,如果它不是空字符串。这些元素确实可以正确地重新填充,因此除了滚动之外,一切都有效。

每当我旋转设备时,阻止滚动的问题可能是什么?

0 个答案:

没有答案
相关问题