在 ScrollVew 中设置的 LinearLayout 中的 TextView 被挤压
TextView in a LinearLayout that is set in a ScrollVew getting squeezed
在这里对这个问题感到疯狂,(明确一点:我查看了 Whosebug 上关于 "scrollview not working" 的所有问题,其中 none 有帮助)。以下是我正在尝试做的事情的简短版本
<ScrollView
android:id="@+id/week_View"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Monday" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Monday" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Monday" />.....
.............
</LinearLayout>
</ScrollView>
Textview 在 linearLayout 中重复多次,如果它没有被清除并且我希望它水平滚动。我得到的是:
您看到最后的 textView 得到 "squeezed",其余的 textview 甚至都没有显示,scrollview 也没有向左或向右移动。我做错了什么? (滚动视图包裹在 RelativeLayout 中)。
ScrollView 始终是垂直的,这意味着它们会上下移动。请改用 HorizontalScrollView。
因为你有 n 个 textView,最好使用
a recyclerview with horizontal layout manager as it wont create memories of all textviews at one go
或者,
you can use a horizontalScrollView to scroll them horizontally..
ScrollView 垂直滚动
在这里对这个问题感到疯狂,(明确一点:我查看了 Whosebug 上关于 "scrollview not working" 的所有问题,其中 none 有帮助)。以下是我正在尝试做的事情的简短版本
<ScrollView
android:id="@+id/week_View"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Monday" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Monday" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Monday" />.....
.............
</LinearLayout>
</ScrollView>
Textview 在 linearLayout 中重复多次,如果它没有被清除并且我希望它水平滚动。我得到的是:
您看到最后的 textView 得到 "squeezed",其余的 textview 甚至都没有显示,scrollview 也没有向左或向右移动。我做错了什么? (滚动视图包裹在 RelativeLayout 中)。
ScrollView 始终是垂直的,这意味着它们会上下移动。请改用 HorizontalScrollView。
因为你有 n 个 textView,最好使用
a recyclerview with horizontal layout manager as it wont create memories of all textviews at one go
或者,
you can use a horizontalScrollView to scroll them horizontally..
ScrollView 垂直滚动