Android TextInputField Inflator Error

后端 未结 13 1317
野的像风
野的像风 2020-12-03 06:55

Had a crash while trying to use the new TextInputField for Android and wanted to share my solution.

Trying the new TextInputField in the android appcomp

13条回答
  •  Happy的楠姐
    2020-12-03 07:41

    None of the solution worked for me. I am using

    compile 'com.android.support:appcompat-v7:28.0.0'
    compile 'com.android.support:design:28.0.0'
    

    Tried all the soluton. My app runs perfectly in devices with lower sdk. But crashes in newer( greater than sdk 26) devices. But after scratching head for 2 days finally got the solution.

    my layout editor showed the error of

    The following classes could not be instantiated: - android.support.design.widget.TextInputLayout

    But it did not gave me enough information to work with. It was not until I looked at other errors at the layout editor. Under render problem I found that

    Couldn't resolve resource @string/path_password_strike_through
    

    I finally got the solution after investigating this render problem. All you need to do is add

    app:passwordToggleDrawable="@string/string_name"
    

    in your TextInputLayout xml file.

                    
    
                        
    
                    
    

提交回复
热议问题