Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/220.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android ScrollView不工作?_Android_Android Layout - Fatal编程技术网

Android ScrollView不工作?

Android ScrollView不工作?,android,android-layout,Android,Android Layout,当我尝试输入xml布局代码时,ScrollView中有两个问题。 第一个问题:我只能在ListView和Overview中看到第一项,电影文本视图文本是隐藏的,第二个问题:是ScrollView只能在方向视图中工作 <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_wid

当我尝试输入xml布局代码时,ScrollView中有两个问题。 第一个问题:我只能在ListView和Overview中看到第一项,电影文本视图文本是隐藏的,第二个问题:是ScrollView只能在方向视图中工作

<?xml version="1.0" encoding="utf-8"?> 
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:fillViewport="true"
    android:padding="16dp">

    <LinearLayout xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        tools:context="**.DetialFragment">

        <TextView
            android:id="@+id/titleDetialMovie"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@color/CadetBlue"
            android:gravity="left"
            android:padding="30dp"
            android:textColor="@color/white"
            android:textSize="40dp" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="left"
            android:orientation="horizontal">

            <ImageView
                android:id="@+id/postImageMovie"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="16dp"
                android:layout_marginTop="16dp"
                android:scaleType="center"
                android:src="@drawable/abc_btn_rating_star_on_mtrl_alpha" />

            <TextView
                android:id="@+id/dateReleaseMovie"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:layout_margin="16dp"
                android:paddingLeft="18dp"
                android:textSize="16dp"
                android:textStyle="bold" />

        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:orientation="vertical"
            android:padding="16dp">

            <RatingBar
                android:id="@+id/ratingMovie"
                style="@style/foodRatingBar"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:isIndicator="true"
                android:numStars="9"
                android:stepSize="0.1" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:paddingTop="10dp"
                android:text="Summary"
                android:textSize="18dp"
                android:textStyle="bold" />

            <TextView
                android:id="@+id/overviewMovie"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:paddingTop="10dp"
                android:textSize="18dp" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:orientation="vertical"
            android:padding="16dp">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:paddingTop="10dp"
                android:text="Review"
                android:textSize="18dp"
                android:textStyle="bold" />

            <FrameLayout
                android:id="@+id/fragment_detial"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                tools:context="**.DetialFragment">

                <ListView
                    android:id="@+id/list_review"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"></ListView>
            </FrameLayout>

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:paddingTop="10dp"
                android:text="List Video"
                android:textSize="18dp"
                android:textStyle="bold" />

            <FrameLayout
                android:id="@+id/fragment_video"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                tools:context="**.DetialFragment">

                <ListView
                    android:id="@+id/list_video"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    ></ListView>
            </FrameLayout>
        </LinearLayout>
    </LinearLayout>
</ScrollView>



您的ScrollView需要位于LinearLayout的内部。我尝试了,但ScrollView仍然不起作用!!!好的,给我一点时间。真是个奇迹!嵌套的可滚动视图会导致问题!好的,谢谢你的回复,但我需要做的是让ScrollView成为活动,而不仅仅是ListView,因为这对用户不友好。而且在定向方面也不起作用landscape@mohammadtofi嵌套的可滚动视图从来都不是用户友好的。
<?xml version="1.0" encoding="utf-8"?>
  <LinearLayout xmlns:tools="http://schemas.android.com/tools"
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="vertical"
  tools:context="**.DetialFragment">

 <ScrollView
 android:layout_width="fill_parent"
 android:layout_height="fill_parent"
 android:fillViewport="true"
 android:padding="16dp">

<TextView
    android:id="@+id/titleDetialMovie"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@color/CadetBlue"
    android:gravity="left"
    android:padding="30dp"
    android:textColor="@color/white"
    android:textSize="40dp" />

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="left"
    android:orientation="horizontal">

    <ImageView
        android:id="@+id/postImageMovie"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="16dp"
        android:layout_marginTop="16dp"
        android:scaleType="center"
        android:src="@drawable/abc_btn_rating_star_on_mtrl_alpha" />

    <TextView
        android:id="@+id/dateReleaseMovie"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_margin="16dp"
        android:paddingLeft="18dp"
        android:textSize="16dp"
        android:textStyle="bold" />

</LinearLayout>

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_weight="1"
    android:orientation="vertical"
    android:padding="16dp">

    <RatingBar
        android:id="@+id/ratingMovie"
        style="@style/foodRatingBar"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:isIndicator="true"
        android:numStars="9"
        android:stepSize="0.1" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:paddingTop="10dp"
        android:text="Summary"
        android:textSize="18dp"
        android:textStyle="bold" />

    <TextView
        android:id="@+id/overviewMovie"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:paddingTop="10dp"
        android:textSize="18dp" />
</LinearLayout>

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_weight="1"
    android:orientation="vertical"
    android:padding="16dp">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:paddingTop="10dp"
        android:text="Review"
        android:textSize="18dp"
        android:textStyle="bold" />

    <FrameLayout
        android:id="@+id/fragment_detial"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        tools:context="**.DetialFragment">

        <ListView
            android:id="@+id/list_review"
            android:layout_width="wrap_content"
            android:scrollbars="vertical"
            android:layout_height="wrap_content"></ListView>
    </FrameLayout>

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:paddingTop="10dp"
        android:text="List Video"
        android:textSize="18dp"
        android:textStyle="bold" />

    <FrameLayout
        android:id="@+id/fragment_video"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        tools:context="**.DetialFragment">

        <ListView
            android:id="@+id/list_video"
            android:layout_width="wrap_content"
            android:scrollbars="vertical"
            android:layout_height="wrap_content"
            ></ListView>
    </FrameLayout>
</LinearLayout>