【发布时间】:2018-10-14 17:34:46
【问题描述】:
我试图在我的 xml 设计中使用材料按钮,但我发现了一个错误。
缺课
找不到 android.support.design.button.MaterialButton 类
我该如何解决这个错误? 我的 xml 和依赖项已附加
这是我的 xml 代码
<android.support.design.button.MaterialButton
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/login"
android:text="Login"
android:layout_marginRight="20dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp" />
依赖
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}
【问题讨论】:
标签: android xml android-studio