Android studio 3.1 XML preview not showing for some XML layouts

后端 未结 15 826
时光取名叫无心
时光取名叫无心 2020-12-08 02:54

Some layouts are shown, some just have blank, gray frame. I can\'t seem to find a correlation between XML layouts that work and those that do not, there is a mixture of use

相关标签:
15条回答
  • 2020-12-08 03:39

    If you unable to see 'preview' with eye icon on the right of the xml text. You have to enable preview from the view. Follow this:- View -> Tool Windows -> Preview

    0 讨论(0)
  • 2020-12-08 03:40

    I've tried pretty much everything from above and nothing worked for me. Then I've downgraded my compileSdkVersion and targetSdkVersion

    compileSdkVersion 27
    targetSdkVersion 27
    

    It worked! I've changed the versions back to 28 and it is still working.

    0 讨论(0)
  • 2020-12-08 03:42

    For me, only "Force Refresh Layout" worked. Restarting, re-building, cleaning didn't work.

    0 讨论(0)
  • 2020-12-08 03:45

    This is a bug in latest versions of Android Studio. The only way i have found to make it work is using forcing refresh layout .

    0 讨论(0)
  • 2020-12-08 03:46

    Layout Screen Not displaying ?

    Just Open Styles.xml from --- Res -> Values -> Styles.xml

    Replace:

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

    With:

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

    Your Display will come immediately. This is by just adding Base.

    0 讨论(0)
  • 2020-12-08 03:47

    i solved it by changing the below dependency

    from

    implementation 'com.android.support:appcompat-v7:28.0.0-alpha3'
    

    to

    implementation 'com.android.support:appcompat-v7:27.1.1'
    
    0 讨论(0)
提交回复
热议问题