Preview not Showing in Android 3.0 Canary

前端 未结 3 992
遥遥无期
遥遥无期 2021-02-04 17:51

I have started using Latest Android Studio 3.0 but I am having a problem with Preview. It\'s not showing Preview in Preview Tab. Here is what I have done



        
相关标签:
3条回答
  • 2021-02-04 18:06

    The following change solved this for me:

    In the styles.xml (app > res > values), in the base application theme - add "base" before the parent style.

    From:

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

    To:

    <style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
    
    0 讨论(0)
  • 2021-02-04 18:14

    hey I had the same problem and i solved it like this: in build.gradle(app) edit the following lines like this:

    compileSdkVersion 25
    buildToolsVersion '25.0.0' 
    
    targetSdkVersion 25
    
    compile 'com.android.support:appcompat-v7:25.3.1'
    

    Hope it works for you!

    0 讨论(0)
  • 2021-02-04 18:15

    What I did was build a new project in Studio 3.0, which worked fine in rendering xml in the design window. I then took all the settings related to sdk versions and compile in dependencies in the new gradle.build APP file and applied them to the gradle.build APP file in the App that was not rendering. I changed to the following:

    compileSdkVersion 26
    
    targetSdkVersion 26
    
    compile 'com.android.support:appcompat-v7:26.1.0'
    compile 'com.android.support:design:26.1.0'
    

    I cleaned and rebuilt the project. At this point I got the following build error:

    Failed to resolve: com.android.support:appcompat-v7:26.1.0

    Add Google Maven repository and sync project

    Show in File

    Show in Project Structure dialog

    I added the Maven repository and cleaned and rebuilt the project. All xml rendering worked after that!

    0 讨论(0)
提交回复
热议问题