Android App开发——添加APP启动界面
生活随笔
收集整理的這篇文章主要介紹了
Android App开发——添加APP启动界面
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1.在創建的項目里面添加一個Empty Activit,我這里命名為BootScreen。
2.把啟動時要顯示的圖像拖到res的mipmap目錄下。
3.在BootScreen.java里面添加代碼
4.activity_boot_screen.xml布局文件
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout 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/gard_bg"tools:context=".BootScreen"><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:layout_centerInParent="true"android:gravity="center"android:orientation="vertical"><ImageViewandroid:layout_width="match_parent"android:layout_height="180dp"android:paddingBottom="40dp"android:src="@mipmap/openapp" /><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="Welcome You!"android:textColor="@android:color/white"style="@style/TextAppearance.MaterialComponents.Headline6"android:textStyle="bold" /><ProgressBarandroid:id="@+id/splashProgress"style="?android:attr/progressBarStyleHorizontal"android:layout_width="150dp"android:layout_height="wrap_content"android:layout_marginTop="50dp" /></LinearLayout></RelativeLayout>5.AndroidManifest.xml里面的啟動順序
5.1更改前
5.2 更改后
6.運行效果如下,這樣一個簡易的啟動界面就完成了。
總結
以上是生活随笔為你收集整理的Android App开发——添加APP启动界面的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 使用深度学习解决拍照文档复杂背景二值化问
- 下一篇: android sina oauth2.