Android Studio 3.6
我想使用Google官方的材料设计组件。为此,我必须使用:
implementation 'com.google.android.material:material:1.2.0-alpha02'
下面是使用组件com.google.android.material.textfield.TextInputEditText
(在xml布局中)的示例:
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/addTraderMainContainer"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/baseTextInputEditText"
style="@style/textViewOneLine"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize="@dimen/edit_text_text_size"
app:layout_constraintEnd_toEndOf="@+id/baseTextView"
app:layout_constraintStart_toStartOf="@+id/baseTextView"
app:layout_constraintTop_toBottomOf="@+id/baseTextView" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
我说的对吗?