android开发去除标题栏的方法
作者:杭州小白 发布时间:2021-06-30 19:11:29
标签:android,标题栏
1:新建一个项目运行起来,可以看到顶部一直有个标题栏看着不是很美观
2:有两种方法可以去除顶部标题栏
(1)将代码中AndroidManifest里android:theme="@style/Theme.MyApplication"改为android:theme="@style/Theme.AppCompat.NoActionBar">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.AppCompat.NoActionBar"
>
(2)在themes.xml文件里改,选中MyApplication,Ctrl+鼠标点击
来到themes.xml文件里,把代码中parent="Theme.MaterialComponents.DayNight.DarkActionBar"替换为
parent=“Theme.AppCompat.Light.NoActionBar”
<style name="Theme.MyApplication" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_500</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_700</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
3:效果展示
来源:https://blog.csdn.net/weixin_44941105/article/details/116076590


猜你喜欢
- 前面已经把java io的主要操作讲完了 这一节我们来说说关于java io的其他内容 Serializable序列化 实例1:对象的序列化
- Spring Security登录表单配置1.引入pom依赖创建一个Spring Boot工程,引入Web和Spring Security依
- 绘制模糊数学中隶属函数分布图using System; using System.Collect
- 首先来个效果图 布局文件代码在布局文件中,CoordinatorLayout作为布局文件根节点,AppBarLayo
- IDEA 初使用昨天,我在某位大神的推荐下,下载了idea编辑器,同时被其强大的功能所震撼。此篇文章去帮助新手小白,来安装并,解决idea安
- 1、 在Java1.7之前,我们需要通过下面这种方法, 在finally中释放资源,这种方法有点繁琐。 BufferedReader br
- 话不多说,下面来直接看示例代码具体代码:DayOfWeek4Birthday.javapackage com.gua;import java
- 本文实例分析了Android编程之TextView的字符过滤功能。分享给大家供大家参考,具体如下:TextView可以设置接受各式各样的字符
- trim标记是一个格式化的标记,可以完成set或者是where标记的功能,如下代码:1、select * from user <tri
- 本文实例为大家分享了Android实现歌词滚动效果的具体代码,供大家参考,具体内容如下自定义TextViewpublic class Ver
- 将jar包发布到Maven中央仓库(Maven Central Repository),这样所有的Java开发者都可以使用Maven直接导入
- SpringBoot默认的页面映射路径(即模板文件存放的位置)为“classpath:/templates/*.html”。静态文件路径为“
- 目录说明使用常见问题No such instance field: 'logger2'说明logback作为log4j的替代
- 目录一、Lambda 表达式简介1、什么是 Lambda 表达式2、为什么需要 Lambda 表达式二、函数式接口和定义1、什么是函数式接口
- 一、序言(一)背景内容软件应用技术架构中DAO层最常见的选型组件为MyBatis,熟悉MyBatis的朋友都清楚,曾几何时MyBatis是多
- 本文实例讲述了安卓Android6.0权限动态获取操作。分享给大家供大家参考,具体如下:众所周知 , 安卓6.0现在运用的越来越广泛 , 因
- Servlet注解之@WebInitParam多个InitParam使用百度了半天也没找到。。。。使用@WebInitParam配置多个In
- 一、背景SpringBoot 为我们快速开发提供了很好的架子,使得我们只需要少量配置就能开始我们的开发工作,但是当我们需要打包上传部署时,却
- 环境介绍 IDEA我用的是2020.2Gradle 安装参考 Gradle安装配置我这安装的是6.6.1C:\Users\herion>
- collection标签的oftype属性能否为java.util.Map基于mybatis-3.4.5.jar版本,结论是可以的。<