如何禁用/抑制“呈现问题”警告

时间:2022-09-06 08:12:35

IDEA keeps raising a popup with message "Rendering Problems Missing styles. Is the correct theme chosen for this layout? …"
Yes, everything is correct, IDEA just doesn't see some symbols from AppCompat library.
Is it possible to suppress these warnings? Because it's very annoying. (I want IDEA to just "shut up" and render everything the best it can, ignoring possible errors.)

IDEA不断弹出消息“呈现问题缺少样式”。这个布局是否选择了正确的主题?是的,一切都是对的,IDEA就是看不到AppCompat库的一些符号。有可能抑制这些警告吗?因为它很烦人。(我希望IDEA只需“闭嘴”,并尽可能地呈现所有内容,忽略可能出现的错误。)

1 个解决方案

#1


0  

The default theme for preview is chosen from:

预览的默认主题选择自:

  1. Your activity theme as defined in manifest when you use tools:context attribute in your layout.

    当您使用工具:布局中的上下文属性时,您的活动主题将在清单中定义。

    <LinearLayout tools:context=".MainActivity"> ... </LinearLayout>

    < = " LinearLayout工具:上下文。MainActivity " >…< / LinearLayout >

  2. Your application theme as defined in manifest.

    在manifest中定义的应用程序主题。

    <application android:theme="@style/Theme.AppCompat"> ... </application>

    <应用android:主题= " @style 主题。appcompat> …< /应用程序>

If the above themes do not extend Theme.AppCompat.* you get the described error and have to manually pick a preview theme.

如果上面的主题没有扩展它们。你得到描述的错误,必须手动选择一个预览主题。

#1


0  

The default theme for preview is chosen from:

预览的默认主题选择自:

  1. Your activity theme as defined in manifest when you use tools:context attribute in your layout.

    当您使用工具:布局中的上下文属性时,您的活动主题将在清单中定义。

    <LinearLayout tools:context=".MainActivity"> ... </LinearLayout>

    < = " LinearLayout工具:上下文。MainActivity " >…< / LinearLayout >

  2. Your application theme as defined in manifest.

    在manifest中定义的应用程序主题。

    <application android:theme="@style/Theme.AppCompat"> ... </application>

    <应用android:主题= " @style 主题。appcompat> …< /应用程序>

If the above themes do not extend Theme.AppCompat.* you get the described error and have to manually pick a preview theme.

如果上面的主题没有扩展它们。你得到描述的错误,必须手动选择一个预览主题。