How to implement an Outlined text
fields presented in Material Design page
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
UPDATE
Also working fine with
Using
implementation 'com.android.support:design:28.0.0-alpha1'
I'm getting below errorSolution
Make below changes in your
Build.Gradle
Use
compileSdkVersion 28
Use
targetSdkVersion 28
Use Below dependencies
Sample code
OUTOUT
With the migration to androidx libraries you have to use the new Material Components for android library.
Use the
TextInputLayout
component:And apply this style:
Requirements:
you have to add this dependencies in your
build.gradle
fileimplementation 'com.google.android.material:material:<version>'
apply a Material Components theme
<style name="Theme.MyApp" parent="Theme.MaterialComponents">
Read
Outline Box
.dependencies
XML
DEMO
You need to add this dependency to your "module level" build.gradle
com.google.android.material
to use latestmaterial UI components
.Use this style in your
com.google.android.material.textfield.TextInputLayout
then,Checkout from here
If you are using appcompact library then you can go with this android.support.design.widget.TextInputLayout
if you are using ANDROIDX build so I come to one conclusion who is having latest code according to android jetpack.
For using this you need to have this dependencies in your app gradle
then this way you can add to your xml for the UI element