【发布时间】:2017-06-16 13:17:14
【问题描述】:
我是 android 开发的新手,我有很多内容,但滚动在我的应用程序上根本不起作用,尝试了 stackoverflow 中的所有答案,但对我没有任何作用。 任何帮助将不胜感激!
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ScrollView01"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:scrollbars="none" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/scoreview"
android:background="@android:color/black"
xmlns:tools="http://schemas.android.com/tools"
tools:context="com.example.saikumar.cricket.ScoreDisplay"
>
<RelativeLayout
android:id="@+id/loadingPanel"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center" >
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminate="true" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/matchtitle_layout">
<Button
android:id="@+id/match_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="10dp"
android:text="Loading..."
android:fontFamily="monospace"
android:textColor="@android:color/white"
android:textSize="13dp"
android:clickable="false"
android:background="@color/colorPrimary"
/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/score_layout"
android:visibility="gone"
android:layout_below="@+id/matchtitle_layout"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<TextView
android:id="@+id/score"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Score"
android:padding="10dp"
android:textColor="@android:color/white"
android:textSize="15dp"
android:fontFamily="monospace"
android:textStyle="bold"
/>
<TextView
android:id="@+id/scoreruns"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="3"
android:text="Score"
android:fontFamily="monospace"
android:padding="10dp"
android:paddingLeft="0dp"
android:textSize="15dp"
android:textColor="@android:color/white"
android:layout_below="@+id/match_title"
android:layout_alignEnd="@+id/overscount" />
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/score_layout"
android:id="@+id/bowler_layout"
android:visibility="gone"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/bowler"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Bowler"
android:padding="10dp"
android:textColor="@android:color/white"
android:textSize="15dp"
android:fontFamily="monospace"
android:textStyle="bold"
/>
<TextView
android:id="@+id/bowlername"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="3"
android:text="Name"
android:fontFamily="monospace"
android:padding="10dp"
android:paddingLeft="0dp"
android:textSize="15dp"
android:textColor="@android:color/white"
android:layout_below="@+id/match_title"
android:layout_alignEnd="@+id/overscount" />
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/innings"
android:layout_below="@+id/bowler_layout"
>
<TextView
android:id="@+id/total"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Loading..."
android:padding="20dp"
android:fontFamily="monospace"
android:textSize="15dp"
android:textColor="@android:color/white"
/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/innings"
android:id="@+id/heading_innings"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/holo_red_light"
android:padding="10dip"
>
<TextView
android:id="@+id/batsman"
android:layout_width="140dp"
android:layout_height="wrap_content"
android:text="BatsMan"
android:fontFamily="monospace"
android:textSize="15dp"
android:textColor="@android:color/white"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="R"
android:fontFamily="monospace"
android:textSize="15dp"
android:textColor="@android:color/white"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="B"
android:fontFamily="monospace"
android:textSize="15dp"
android:textColor="@android:color/white"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="4s"
android:fontFamily="monospace"
android:textSize="15dp"
android:textColor="@android:color/white"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="6s"
android:fontFamily="monospace"
android:textSize="15dp"
android:textColor="@android:color/white"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="SR"
android:fontFamily="monospace"
android:textSize="15dp"
android:textColor="@android:color/white"
/>
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/batting_reltive_layout_one"
android:layout_below="@+id/heading_innings"
>
<ListView
android:id="@+id/batting_runs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="8dp"
android:padding="1dp"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/inningstwo"
android:layout_below="@+id/batting_reltive_layout_one"
>
<TextView
android:id="@+id/totalsecond"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Loading..."
android:padding="20dp"
android:fontFamily="monospace"
android:textSize="15dp"
android:textColor="@android:color/white"
/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/inningstwo"
android:id="@+id/heading_innings_two"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/holo_red_light"
android:padding="10dip"
>
<TextView
android:layout_width="140dp"
android:layout_height="wrap_content"
android:text="BatsMan"
android:fontFamily="monospace"
android:textSize="15dp"
android:textColor="@android:color/white"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="R"
android:fontFamily="monospace"
android:textSize="15dp"
android:textColor="@android:color/white"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="B"
android:fontFamily="monospace"
android:textSize="15dp"
android:textColor="@android:color/white"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="4s"
android:fontFamily="monospace"
android:textSize="15dp"
android:textColor="@android:color/white"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="6s"
android:fontFamily="monospace"
android:textSize="15dp"
android:textColor="@android:color/white"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="SR"
android:fontFamily="monospace"
android:textSize="15dp"
android:textColor="@android:color/white"
/>
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/batting_reltive_layout_two"
android:layout_below="@+id/heading_innings_two"
>
<ListView
android:isScrollContainer="false"
android:id="@+id/batting_runs_two"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="8dp"
android:padding="1dp"/>
</RelativeLayout>
</RelativeLayout>
</ScrollView>
【问题讨论】:
-
在这里遇到同样的问题..
-
问题是滚动视图中的列表视图。 stackoverflow.com/questions/18367522/…
标签: android android-layout listview scroll