gpt4 book ai didi

android - Outlined TextInputLayout 渲染不正确

转载 作者:行者123 更新时间:2023-11-29 23:37:32 25 4
gpt4 key购买 nike

使用新的 Material Design 指南,我正在尝试创建一个带轮廓的文本字段。

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:padding="10dp">

<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:boxStrokeWidth="2dp"
app:boxStrokeColor="@color/colorPrimary"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">

<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content" />

</com.google.android.material.textfield.TextInputLayout>

结果没有轮廓或外观变化。 Android Studio 会抛出渲染问题。 '无法解析资源@string/path_password_strike_through'。我曾尝试重建和清理项目,但没有成功。

任何想法都会很棒,谢谢。

最佳答案

我有同样的问题,添加此 app:passwordToggleDrawable="@string/your_string" 并在呈现 TextInputLayout 时出现错误,提示 Couldn't resolve resource @string/path_password_strike_through 不见了。

<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:boxStrokeWidth="2dp"
app:boxStrokeColor="@color/colorPrimary"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
app:passwordToggleDrawable="@string/your_string">

关于android - Outlined TextInputLayout 渲染不正确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52108379/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com