Android:TextView:删除顶部和底部的间距和填充

新手上路,请多包涵

When I have a TextView with a \n in the text,, on the right I have two singleLine TextView s, one below the其他之间没有间距。我为所有三个 TextView 设置了以下内容。

 android:lineSpacingMultiplier="1"
android:lineSpacingExtra="0pt"
android:paddingTop="0pt"
android:paddingBottom="0pt"

左边的第一行 TextView 与右上角 TextView 完美对齐。

左边第二行 TextView TextView 一点。

似乎在 TextView 的顶部和底部有某种隐藏的填充。我怎样才能删除它?

原文由 700 Software 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 558
1 个回答

你可以尝试使用这个属性(ConstraintLayout): layout_constraintBaseline_toBaselineOf

原文由 Tyhoo Wu 发布,翻译遵循 CC BY-SA 4.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题