android - 滚动视图和嵌套滚动视图不起作用
问题描述
我在滚动视图和嵌套滚动视图中使用这种布局方式的滚动视图都不起作用
<RelativeLayout>
<scrollview>
<LinearLayout>
<LinearLayout>
</LinearLayout>
<LinearLayout>
</LinearLayout>
</LinearLayout>
</scrollview>
</RelativeLayout>
在 scorll 视图中,我正在尝试填充视图,滚动条也像这样垂直,但这一切都不起作用。我在片段里面做。
解决方案
它在我的代码中运行良好,
你可以试试这个:
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:fillViewport="true"
android:layout_height="wrap_content" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
//Your Widgets....
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
//Your Widgets....
</LinearLayout>
</LinearLayout>
</ScrollView>
推荐阅读
- ruby-on-rails - 如何在 Rails 中使用连接查询?
- php - PHP - 在 CASE STATEMENT 中为 DB 中的两列使用 STRTOTIME
- c# - 将此 .RDL 代码转换为可读的 SQL 查询代码
- apache-nifi - NiFi 如何在 UpdateAttribute 处理器中获取更新的 JSON 值?
- jenkins - helm install stable/jenkins 失败:PodInitializing
- android - 检查 textview 中整个内容的高度是否大于 textview 的高度
- android - 客户端连接时 Master 停止广告后 Google Nearby API 出现问题
- java - 在日志行之前打印新行,使用 Java 中的日志框架
- python - 如何根据熊猫组合的最高出现率填写值?
- c - 使用 rootfs 进行 GCC 交叉编译