android - Rendering problems using new TextInputLayout for EditText -


i'm trying set new support.desing library provides lollipop visual effects old android versions.

in case, i'm triying add floating labels edittext, done widget.textinputlayout:

enter image description here

to have followed google's provided few indications:

  • i have downloaded last support library (22.2.0) , included on graddle file.

    compile 'com.android.support:design:22.2.0'

  • i have added textinputlayout in xml way:

<android.support.design.widget.textinputlayout     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:layout_margintop="30dp"     android:layout_marginleft="20dp">      <edittext         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:ems="12"         android:hint="hint"         android:inputtype="number"         android:id="@+id/edt" /> </android.support.design.widget.textinputlayout> 

but android studio showing in layout preview:

rendering failed known bug. please try rebuild.   following classes not instantiated: - android.support.design.widget.textinputlayout (open class, show exception, clear cache)  exception details  java.lang.nosuchfielderror: textappearance 

this style i'm using:

<style name="materialtheme.base" parent="theme.appcompat.light.noactionbar">     <item name="colorprimary">@color/md_red_500</item>     <item name="colorprimarydark">@color/darkprimarycolor</item>     <item name="coloraccent">@color/md_green_500</item>     <item name="android:textcolorprimary">@color/md_grey_900</item>     <item name="android:textcolorsecondary">@color/md_grey_600</item> </style> 

edit-

enter image description here

solved. had add this:

<android.support.design.widget.textinputlayout             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_margintop="30dp"             android:layout_marginleft="20dp"             app:hinttextappearance="@style/textappearence.app.textinputlayout"> 

where is:

<style name="textappearence.app.textinputlayout" parent="@android:style/textappearance">     <item name="android:textcolor">@color/accentcolor</item> </style> 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -