【发布时间】:2019-03-14 05:30:15
【问题描述】:
如果我在按钮中添加回车,顶部会出现额外的“边距”(由于缺乏更好的解释):
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ff992a2a">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="200dp">
<Button
android:layout_width="250dp"
android:layout_height="100dp"
android:text="Extend" />
<Button
android:layout_width="250dp"
android:layout_height="100dp"
android:text="Accept
0:23"/>
</LinearLayout>
</RelativeLayout>
如何阻止出现额外的“边距”?我尝试设置android:lines="2" 和/或android:singleline="false",但似乎没有任何帮助。
【问题讨论】:
标签: android android-layout button line-breaks