Blank screen in android preview

心不动则不痛 提交于 2019-12-19 11:47:00

问题


So I have a problem with android studio. Mine "preview" is just a blank screen without content,that i actually added. When i run it on avd,i can see this button,and text view,unfortunetly the preview screen is still blank. I don't have any extra libraries,i reinstaled android studio couple of times and just created like ten new project - every case is ending same.

How it's look actually - https://imgur.com/a/OX3JNLk


回答1:


Update the build.gradle file so the "compileSdkVersion" and "targetSdkVersion" matches the version you are running your emulator.

For example

compileSdkVersion 26
buildToolsVersion '26.0.2'
targetSdkVersion 26
compile "com.android.support:support-v4:26.0.2"
compile "com.android.support:design:26.0.2

Also try some of the options mentioned here instead of preview, Android Studio showing only black screen with 'android...ActionBarOverlayLayout' written on it. Like Goto: src -> main -> res -> style.xml and add Base. to the style tag parent attribute.

<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
...
</style>



回答2:


That may be a rendering problem. So you may try to change the app theme. Click on App Theme and select Holo Light then click Ok. Hope this would help you.



来源:https://stackoverflow.com/questions/50844399/blank-screen-in-android-preview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!