【发布时间】:2015-03-28 08:54:03
【问题描述】:
我浪费了最后一个小时试图弄清楚如何在一个简单的 EditText 中摆脱这种填充:
我想要的只是将输入与其余内容对齐,就像漂亮的design guide 所说的那样。
布局再简单不过了:
<ScrollView 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"
tools:context="com.actinarium.tiomantas.SetupChallengeFragment">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/new_challenge_name"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/new_challenge_name_hint1"
android:singleLine="false"/>
</LinearLayout>
</ScrollView>
我尝试将 EditText 上的填充设置为 0dp — 文本移动但行保持原样。奇怪的是,我找不到任何关于这个问题的信息,好像没有人注意到一样。
【问题讨论】:
-
P.S.有些东西告诉我,就像 Android 中的其他任何东西一样,即使对于这个微不足道的事情,我也必须制作自己的可绘制对象......我只是想知道为什么他们的原生小部件不遵循自己的设计规范......
标签: android android-layout android-edittext