带有Androidx的材质OutlinedBox提示

问题描述 投票:0回答:1

我指的是:Outlined Edit Text from Material Design,答案与过时的支持库有关,而不是androidx。

如何通过在左上角的提示框]来创建OutlinedBox,而不是在框内?整个上午都失败了。我想要的是:enter image description here

我的毕业证书:

implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.1.0'

我的应用主题:

style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar"

我的布局:

<com.google.android.material.textfield.TextInputLayout
                android:id="@+id/textField"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="20dp"
                style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
                android:hint="Full name" >

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

我的结果(帧是连续的,没有在左上角嵌入提示):

result

我指的是:Material Design的大纲编辑文本,答案与过时的支持库有关,而不是与androidx相关。如何通过在...

android android-layout material-design androidx textinputlayout
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.