InflateException with TextInputLayout and AlertDialog

前端 未结 7 614
被撕碎了的回忆
被撕碎了的回忆 2020-12-11 05:55

I am trying to use the newest TextInputLayout in my DialogFragment.

Here\'s my code:



        
7条回答
  •  旧巷少年郎
    2020-12-11 06:46

    • extend your activity from AppCompatActivity
    • extend your (dialog)fragment from android.support.v4.app.Fragment.
    • use latest version of design library.
    • Instead of using EditText, use android.support.v7.widget.AppCompatEditText. For example:

          
      
                          
      
          
      

    Also, if you didn't do so already: Set AppCompat theme in your manifest application tag:

    
    

    And inherit AppCompat at your styles.xml as root for your activity styles etc.: