java - 从 Android RelativeLayout 中删除填充和边距
问题描述
我已经尝试了一切,但无法弄清楚如何删除每个块之间的空格。它们是由用户输入生成的集合,因此代码用于模板
<LinearLayout
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:textAlignment="center"
android:gravity="center_horizontal"
android:weightSum="100"
android:layout_margin="0dp"
android:paddingBottom="0dp"
android:paddingTop="0dp"
android:layout_marginBottom="-20dp"
android:divider="@null"
android:dividerHeight="0dp"
xmlns:xmls="http://schemas.android.com/apk/res-auto">
解决方案
最好的解决方案是,如果您将 recyclerview 与适配器一起使用。这是一个很好的教程。显然,在相对布局部分,您需要使用包装内容并匹配父级。
推荐阅读
- azure - 如何将消息从 ServiceBusQueueTrigger Azure 函数发送到 Durable Function
- json - 使用 jq 将 JSON 导出为 CSV
- python-3.x - 将 csv 文件数据导入 pandas 数据框时出错
- typescript - 通过 Typescript 中实现的接口捕获错误
- json - JsonSerializable 与 dart 中的子类
- unit-testing - 如何从 Visual Studio 中运行 XUnit 测试?
- c++ - 错误:“系统找不到指定的文件”。在实现循环链表时
- reactjs - react-admin 作为 Gatsby 项目中的一个页面
- php - 有没有办法避免在 where 子句中进行数字到字符串的转换?
- html - 在 React 中使用的 handleChange 与 OnChange 有什么区别?