简体   繁体   中英

Blank screen in android preview

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

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>

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.

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM