<com.google.android.material.textfield.TextInputLayout
...
app:hintEnabled="false">
<com.google.android.material.textfield.TextInputEditText
...
android:hint="e.g. 350"/>
</com.google.android.material.textfield.TextInputLayout>
default:
focused:
typed:
<!-- define a style -->
<style name="ColoredHandleTheme">
<item name="colorControlActivated">@android:color/black</item>
</style>
<!-- set up theme -->
<com.google.android.material.textfield.TextInputLayout
...>
<com.google.android.material.textfield.TextInputEditText
...
android:theme="@style/ColoredHandleTheme"/>
</com.google.android.material.textfield.TextInputLayout>
<TextView
...
android:textSize="16sp"
android:lineSpacingMultiplier="0"
android:lineSpacingExtra="24sp" />
根据Google官方文档解释,文字最后一行lineSpacingExtra
不生效,因此单行文字也不生效,所以可以通过以下方式设置:
<TextView
...
android:layout_width="24sp"
android:gravity="center_vertical"
android:textSize="16sp" />