嗨,我必须将我的应用程序主题更改为“Theme.AppCompat.Light.NoActionBar”。但是在我更改它之后,应用程序崩溃了。我找不到问题出在哪里:/
我的目标是在工具栏上扩展我的导航抽屉。但为此,我需要“NoActionBar”功能。我希望有人可以帮助我。感谢转发!
那是调试器的错误代码:
12-23 11:04:28.292 1410-1421/? E/ANDR-PERF-LOCK: Failed to apply optimization for resource: 4 level: 0
Run Code Online (Sandbox Code Playgroud)
那是我的styles.xml 代码:
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:listDivider">@android:color/transparent</item>
</style>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
</resources>
Run Code Online (Sandbox Code Playgroud) 我想在android' WebView'中删除网站的标题。使用我拥有的代码,它可以工作。但是问题是WebView页面完全加载后,' '正在删除标头。我要在加载时将其删除。
那就是代码片段:
webView.setWebViewClient(new WebViewClient() {
@Override
public void onPageFinished(WebView view, String url)
{
webView.loadUrl("javascript:(function() { " +
"var head = document.getElementsByTagName('header')[0];"
+ "head.parentNode.removeChild(head);" +
"})()");
webView.loadUrl("javascript:(function() { " +
"var head = document.getElementsByTagName('footer')[0];"
+ "head.parentNode.removeChild(head);" +
"})()");
}
});
Run Code Online (Sandbox Code Playgroud)