我尝试制作一个Webview,它适用于android:theme="@style/Theme.AppCompat"
但当我尝试使用android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
或android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
或android:theme="@android:style/Theme.Light.NoTitleBar.Fullscreen"
它抛出异常。
这是例外
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.testing.view.webview/com.testing.view.webview.PinchoPancho}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
它告诉我使用/添加Theme.AppCompat,但如果我使用它,它没有全屏显示选项。
其他所有内容都是默认代码,所以我不会发布它。我怎样才能使用Theme.AppCompat全屏?
答案 0 :(得分:0)
尝试使用此主题
<style name="Theme.AppCompat.Light.NoActionBar.FullScreen" parent="@style/Theme.AppCompat.Light">
<item name="android:windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowContentOverlay">@null</item>
</style>
答案 1 :(得分:0)