RuntimeException while using new TextInputLayout from support design library

后端 未结 6 716
情话喂你
情话喂你 2020-12-10 03:37

I have very simple layout where I use new android.support.design.widget.TextInputLayout view from Design Support Library



        
6条回答
  •  一生所求
    2020-12-10 03:58

    getColor crashes, you can try two things:

    1.Instead of using EditText, use android.support.v7.widget.AppCompatEditText. For example:

    
                    
    
    
    

    2.If that doesn't help, this might, but it will remove the color of your hint when the input field is selected. Add:

                app:hintTextAppearance="@android:style/TextAppearance.Small"
    

    to your TextInputLayout.

提交回复
热议问题