android - MaterialDesign TextInputLayout 缩放问题
问题描述
当我运行 360x640 时,它看起来很完美,但是当我使用更高分辨率时,它开始看起来像这样:
代码:
// TOP INPUT
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/dob_input_layout"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:focusable="false"
android:hint="@string/date_of_birth"
app:endIconDrawable="@drawable/ic_more_arrow"
app:endIconMode="custom"
app:layout_constraintEnd_toEndOf="@+id/bottom_text"
app:layout_constraintStart_toStartOf="@+id/bottom_text"
app:layout_constraintTop_toBottomOf="@+id/bottom_text">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/dob_input_et"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusable="true"
android:hint="@string/_12_15_2000"
android:importantForAutofill="no"
app:layout_constraintBottom_toTopOf="@+id/last_name_layout_input"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/bottom_text" />
</com.google.android.material.textfield.TextInputLayout>
// BOTTOM INPUT
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/phoneNumber_input_layout"
style="@style/TextInputLayoutTransparent"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:focusable="false"
android:hint="@string/phone_number"
android:paddingTop="8dp"
app:endIconDrawable="@drawable/ic_more_arrow"
app:endIconMode="custom">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/phoneNumber_input_et"
style="@style/text_input_black_left"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:ems="10"
android:focusable="false"
android:hint="@string/set_your_phone_number"
android:importantForAutofill="no"/>
</com.google.android.material.textfield.TextInputLayout>
我尝试的是在 TextInputLayout 和 TextInputEditText 之间使用一些自定义填充,但它没有任何改变。第一个输入是默认样式,另一个是自定义样式,这是我认为值得研究的另一件事。
编辑
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
style-v27 及更高版本中存在的这个小小鬼正在产生这种效果,当我摆脱它时,它看起来很完美。任何人都知道可能是什么原因?
解决方案
推荐阅读
- ios - iOS - 设计具有透明背景的自定义 UITextField 的最佳方法
- nativescript - NS 应用程序在卸载和安装时不会重置设置 (Android)
- vue.js - Vue Route Params
- excel - 将工作表复制到新工作表
- c# - 将 Button/PictureBox 动态插入到 PictureBox 中
- azure - Azure Active Directory - 更新用户 - 目标实体集当前不支持该请求
- fiware-orion - fiware-servicepath 的标头值与通知的上下文响应的数量不匹配
- google-chrome - 当我没有打开任何 Facebook 应用程序/网址时,为什么 Facebook 可以向 chrome 发送推送通知?
- android - 从 iOS 应用程序调用时,Android 上的本机 Web RTC 视频通话冻结
- jenkins - 如何在 Jenkins 中自动触发多分支管道