Android studio2022.3项目,X5内核WebView页面,顶部栏不显示问题

顶部栏组件和WebView都位于Fragment页面中,顶部栏不显示可能是由布局类型导致,可以使用LinearLayout类型布局

XML 复制代码
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <!-- 设置Toolbar -->
    <androidx.appcompat.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        android:elevation="4dp"/>

    <!-- 设置WebView -->
    <com.tencent.smtt.sdk.WebView
        android:id="@+id/web_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</LinearLayout>
相关推荐
HZero.chen22 分钟前
从 APK 到 APEX:以 PermissionController 为例拆解 Android 模块化演进与部署实战
android
你看我名字4 小时前
OpenAI 兼容接口能不能直接接入:数眼智能大模型 API 迁移实战与兼容性检查
android·java·数据库·大模型平台选择
用户69371750013844 小时前
用上 AI 之后,Android 的边界确实在消失,但我的活反而变多了
android·人工智能·ai编程
AI2中文网4 小时前
App Inventor 做的表单怎么导出 PDF?WebViewer + JavaScript 在本地生成并保存 PDF 的完整示例
android·开发语言·javascript·pdf·鸿蒙·app inventor
应用市场5 小时前
安卓底层拆解(二)· 改成 user 版为什么开不了机:合成密码与启动状态
android
星夜离尘565 小时前
MATLAB:标定表局部倒退,为什么不能排序?
android·开发语言·matlab
StarsGreen5 小时前
Android 12环境下检查v4l2_code的接入方法
android
纪念 2296 小时前
C++ 算法模板与错题 模拟(一)
android·c++·算法
Jason_zhao_MR8 小时前
米尔MYD-JR3576开发板 Android 15系统正式发布
android·linux·嵌入式硬件·嵌入式
右手吉他9 小时前
打开Android hostapd 调试
android