[英]Android - ScrollView doesn't work
我创建了这个布局。 在 LinearLayout 中有一些 TextViews。 如果我在模拟器上运行它,我可以在活动冻结后滚动几秒钟。(在列表视图中滚动工作正常!)。 在我的应用程序中返回 MainActivity 工作。
此活动对应的 java 文件是在 eclipse 中创建新活动时将获得的默认文件。
我做错了什么吗?
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin" >
<!-- stuff -->
</LinearLayout>
</ScrollView>
将 android:layout_height="match_parent" 更改为 android:layout_height="wrap_content"
将 themes.xml 或 styles.xml 中的 parent 属性更改为:
<style name="dont touch this" parent="Theme.AppCompat.DayNight.NoActionBar">
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.