安卓启动图去除顶部title和状态栏
1.在启动页的xml配置中,设置layout的id,
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/back"
android:id="@+id/img_lay"
tools:context="com.zhou.myapplication.LaunchImgActivity">
</LinearLayout>
2.在启动的activity类中加入如下代码:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.launch_img);
//去除状态栏
LinearLayout linearLayout =(LinearLayout)findViewById(R.id.img_lay);
linearLayout.setSystemUiVisibility(View.INVISIBLE); //设置不可见
//延迟加载主页面
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
Intent intent = new Intent(LaunchImgActivity.this, MainActivity.class);
LaunchImgActivity.this.startActivity(intent);
LaunchImgActivity.this.finish();
}
}, 2000);
}
3.在style.xml中修改成如下代码,主要是把parent改为NoActionBar:
<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:fitsSystemWindows">true</item>
<item name="android:clipToPadding">false</item>
</style>
运行之后可以看到启动图全屏展示。
安卓启动图去除顶部title和状态栏的更多相关文章
- iOS LaunchScreen和LaunchImage的转换启动图
今天开始设置一个新项目的启动图,需要我自己设置,我在UI那拿到以前格式的启动图不知道为何需要那么多图,我记得用LaunchScreen只需一张即可,利用自动布局,今天看到这么多图,发现他用的是Laun ...
- ios 和安卓常用图标、启动图 尺寸
---------------------------------------------ios---------------------------------------------------- ...
- Safari配置WebApp----添加启动图和桌面图标让你的WebApp在ios设备上体验如原生一样
现在很多开发者的Web应用程序的设计样式和交互类似本机应用程序,例如,它的缩放比例适合iOS上的整个屏幕.当用户将其添加到主屏幕时,您可以通过使其看起来像本机应用程序一样,在iOS上为您的Web应用程 ...
- 自定义 SharePoint 2010 快速启动栏和顶部链接栏
转:http://vickynuli.blog.163.com/blog/static/180438492201281434249486/ 在网上找到篇文章,自定义快速启动栏和顶部链接栏,以下为代码, ...
- 用launchscreen.storyboard适配启动图方法
wwdc2019有session提出.到2020年4月,上架APP的启动图必须使用launchscreen.storyboard,不能再使用assert方式了.但是session没有给出如何适配.网上 ...
- iOS - iPhone屏幕适配/启动图适配/APP图标适配(iPhone最全尺寸包含iPhoneX/XR/XS/XS Max等)
趁iPhone新品还没有发布,先整理一下屏幕适配.启动图适配.APP图标适配的笔记,方便以后查阅: 注:部分图片来源于网络 违删; (一)iPhone屏幕适配: (1)屏幕分辨率: ①设计尺寸规范(表 ...
- flutter添加启动图及设置启动时间
首先贴个官方的设置方法,看这里:https://flutterchina.club/assets-and-images/#%E6%9B%B4%E6%96%B0%E5%90%AF%E5%8A%A8%E9 ...
- 17.iOS App设置icon,启动图,App名称的方法
icon:选择Assets-->AppIcon-->将各种尺寸的icon拖拽到相应的框中. APP名称:选择info-->Bundle name,修改APP名字. 启动图: 首先点击 ...
- Android开发如何去除标题栏title(转)
去除标题栏title其实非常简单,他有两种方法,一种是在代码中添加,另一种是在AndroidManifest.xml中添加: 1.在代码中实现:在此方法setContentView(R.layout. ...
随机推荐
- springMVC-接收数据-参数绑定
接收数据-参数绑定 #Method Arguments概观 Same in Spring WebFlux The table below shows supported controller meth ...
- morphia(5)-删除
@Test public void delete() throws Exception { final Query<Employee> query = datastore.createQu ...
- 安装linux时的分区问题,需要了解目录树及挂载知识
Linux是目录树架构,如何结合目录树架构与磁盘内的数据→挂载. Linux先有目录,后有磁盘分区.数据(文件)依存于目录. 目录为挂载点,磁盘分区的数据放置在该目录下,进入该目录,就可以读取该分区. ...
- nginx 配置步骤
D:\myphp2017\nginx\conf.nginx.conf37行 吧localhost 改为www.ff.com41行取消注释44行 加D:\myphp2017\nginx\html45 在 ...
- asp.net 图表
感谢csdn深南大道,文章转自http://blog.csdn.net/smartsmile2012/article/details/17356673 前台代码 <div> <asp ...
- Windows下Apache+PHP+MySQL开发环境的搭建(WAMP)
准备工作: 1.下载apache服务器安装包,官网http://www.apache.org/,下载地址:http://httpd.apache.org/download.cgi 2.下载MySQL, ...
- dp考试
a[问题描述]
- 第5章 引用类型---JS红宝书书摘系列笔记
在ECMAScript中,引用类型是一种数据结构,用于将数据和功能组织在一起,描述的是一类对象所具有的属性和方法.而对象是某个特定引用类型的实例. 一.Object类型 可以通过Object构造函数创 ...
- KMP字符串模式匹配详解
KMP字符串模式匹配详解 http://www.cppblog.com/oosky/archive/2006/07/06/9486.html
- git的基本使用命令操作
Linux操作命令行: mkdir - 创建文件夹, cd - 切换文件路径 pwd - 显示文件路径 ls -ah - 可以查看隐藏的文件夹名(.git) cat 文件 ...