0
此錯誤後:android.support.v4.widget.DrawerLayout找不到
android.support.v7.internal.widget.ActionBarOverlayLayout could not be Found
我看不到的preview
我的活動 - Android Studio中在本教程中:
http://www.android4devs.com/2014/12/how-to-make-material-design-navigation-drawer.html
我正在使用最新版本的android studio:1.2.1.1
這裏是我的Build.Gradle
:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.0"
defaultConfig {
applicationId "com.client.test"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.1.1'
compile 'com.android.support:recyclerview-v7:22.0.0'
compile 'com.android.support:cardview-v7:22.0.0'
compile 'de.hdodenhof:circleimageview:1.2.1'
}
那麼,如何才能解決這個問題呢?
我試過了嗎? :重建並更新到appcompat-v7:22.1.1但它不能解決問題。
如果我將其更改爲android.support.v7.widget.DrawerLayout
它表示更改爲V4!
任何解決方案都非常感謝。
就可以運行這個項目?它崩潰了嗎?或者你只是看不到預覽? –
哦,你的意思是你只是無法在Android Studio的預覽窗口中看到DrawerLayout,但該應用程序運行得很好,沒有任何崩潰? –
這是完全正常的。 Android Studio目前並未設計爲在其預覽窗口中正確顯示DrawerLayout,RecyclerView,CardView等。它只能顯示ListView,TextView,ImageView等等。也許在未來的更新中,Android Studio將能夠顯示這些東西,但目前還沒有。如果你的應用程序正在運行,那麼你的代碼沒有問題。別擔心。 –