android - 如何从 TextInputLayout 中删除白框
问题描述
今天我刚刚更新了我dependencies
的material design
从1.0.0
到1.1.0-alpha09
implementation 'com.google.android.material:material:1.1.0-alpha09'
现在我遇到了奇怪的问题com.google.android.material.textfield.TextInputLayout
这是我的代码
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/emailTextInputLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/_10sdp">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/emailTextInputEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/hint_enter_email"
android:imeOptions="actionNext"
android:inputType="textEmailAddress"/>
</com.google.android.material.textfield.TextInputLayout>
更新依赖项后,我得到了盒装设计TextInputLayout
上述代码的输出
如果我使用implementation 'com.google.android.material:material:1.0.0'
我会得到预期的结果
谁能帮我解决这个问题
如果需要更多信息,请告诉我。提前致谢。您的努力将不胜感激。
更新
我已经试过
app:boxBackgroundMode="none"
了,我得到了这个
,
如果我使用
app:boxBackgroundMode="outline"
然后得到这个
解决了
无需使用boxBackgroundMode
您需要@style/Widget.Design.TextInputLayout
在您的TextInputLayout
示例代码
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/emailTextInputLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/_10sdp"
style="@style/Widget.Design.TextInputLayout"
app:errorTextAppearance="@style/error_appearance"
android:textColorHint="@android:color/white">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:id="@+id/emailTextInputEditText"
android:layout_height="wrap_content"
android:backgroundTint="@android:color/white"
android:gravity="center"
android:hint="@string/hint_enter_email"
android:imeOptions="actionNext"
android:textColorHint="@android:color/white"
android:inputType="textEmailAddress"
android:textColor="@android:color/white"
android:textSize="@dimen/_15ssp"/>
</com.google.android.material.textfield.TextInputLayout>
解决方案
推荐阅读
- javascript - 在 TweenLite 中使用 text 方法显示未定义
- python-3.x - 我可以在单个 Cisco IOS 配置文件中使用两个 ciscoconfparse 对象来获取特定接口吗
- jsf - 为什么@Model 是@RequestScope 而不是@SessionScope 或@ViewScope?
- c++ - 相机标定数据检索
- r - 使用 Shiny App 动态可视化字符串替换的每次迭代?
- javascript - 开玩笑快照测试错误:您不应该在外部使用
- geojson - 是否有任何 REST API 服务可用于将 geoJSON 文件提交到 GeoMesa?
- laravel - Laravel 关系 $this 在使用 'with' 函数访问时返回 null
- scala - ScalaPlay > 2.6 如何在测试中伪造普通服务器时访问 POST 请求
- json - python3.6如何将两个json文件合并为一个