如何在eclipse adt中使用textinputlayout

时间:2015-08-26 05:43:30

标签: android

我尝试在Eclipse ADT中实现textinputlayout(不在Android Studio中),我还包括库android-support-design.jar。

但我在渲染XML文件屏幕时出错:

错误是:

cast to android.view.ViewGroup
Exception details are logged in Window > Show View > Error Log
The following classes could not be instantiated:
- android.support.design.widget.TextInputLayout (Open Class, Show Error Log)
See the Error Log (Window > Show View) for more details.

1 个答案:

答案 0 :(得分:3)

  1. 确保您拥有Android支持库,修订版22.2.0或 更高。
  2. TextInputLayout是设计支持库的一部分。
  3. 您需要import <android-sdk>/extras/android/support/design
  4. 您需要import <android-sdk>/extras/android/support/v7/appcompat
  5. 导入设计库后,您需要编辑project.proerties文件,如下所示:

    # Project target.
    target=android-21
    android.library.reference.1=../v7/appcompat
    android.library=true