navigation drawer issue (not showing layout preview)

半城伤御伤魂 提交于 2019-11-28 12:06:30

Remove the line

tools:showIn="navigation_view"

from activity_main_drawer.xml and rebuild. This solved the same problem for me. Don't know why!!!

Problem solved in AS 3.1.3(8 June 2018) and reappeared again (16 June 2018)!!!

New temporary workaround:

  1. Cut the line tools:showIn="navigation_view" from the menu file.
  2. Close the menu file.
  3. Reopen it and paste the line.
  4. Go to design and see the menu as it should be.

If you close the menu file and reopen it the problem comes back! Still no preview in Text.

You can try the following:

  • Run Build then try to see the preview again

  • Close the current layout,open another then reopen again

Because you extend AppCompatActivity, you need to make sure that in your styles.xml your AppTheme is a descendant of AppCompat

    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
     </style>

That worked for me while the accepted answer for not that helping.

I have found the solution. Remove these two tool lines and close/reopen:

  • xmlns:tools="http://schemas.android.com/tools"

  • tools:showIn="navigation_view"

rebuilduing the project worked for me

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