android - android:相对布局中两个文本视图之间的间隙
问题描述
Android:我想在两个 textview 之间有 20 dp 的差距,我正在使用相对视图并且已经使用过 textview 2 应该低于 textview 1 ,但我不明白如何在这两个 textview 之间提供更多差距
解决方案
您可以使用填充或边距。我建议保证金。
<TextView
android:text="text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/your_id"
android:layout_margin="20dp" />
编辑:
感谢@Gabe Sechan 扩大答案。如果您只想要一侧的边距,您可以使用您想要的一侧的特定边距指令。例子:
仅底部边距
<TextView
android:text="text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/your_id"
android:layout_marginBottom="20dp" />
而另一边
android:layout_marginTop
,android:layout_marginLeft
和android:layout_marginRight
.
推荐阅读
- excel - 设置形状的字体大小
- python - 您如何为 StandardScaler 编写 Python 函数?
- cmake - 如何正确地将存储在磁盘上的第三方项目包含到我的 cmake 项目中?
- f# - F# 以及如何使用泛型
- c++ - C++ 应用程序仅在使用本地 Windows 调试器时运行,而不是在哪个 exe 文件中运行
- django - 如何调试 gunicorn [6383] [CRITICAL] 工作人员超时?
- javascript - 无法读取未定义的属性“rollupVersion”或如何使用 rollup 和 babel 设置 gulp
- javascript - 通过jquery调用对象函数
- excel - 在 Excel VBA 中将对象添加到集合时遇到问题
- react-native - 需要按 flatlist child 2/3 秒才能实际移动到链接