<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                手機安全衛士項目是跟著黑馬的視頻做的。 splash是飛灑、飛濺的意思,主要是用于完成一個產品logo顯示,期間可以: 1. 后臺完成數據庫初始化的操作 1. 聯網訪問服務器,獲取服務器最新信息(升級提示) 1. 不同的日期顯示出來不同logo,判斷當前系統時間,素材一般從服務器上下載下來. 1. 判斷時間,根據不同時間顯示不同的加載頁面 ### 布局文件:splash.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:background="@drawable/logo2" android:gravity="center_horizontal" android:orientation="vertical" android:id="@+id/ll_splash_main" > <TextView android:layout_marginTop="320dip" android:id="@+id/tv_splash_version" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#FFff5f00" android:textSize="20sp" android:text="版本號" /> <ProgressBar android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="20dip" /> </LinearLayout> ~~~ ### activity:SplashActivity ~~~ package com.liuhao.mobilesafe.ui; import com.liuhao.mobilesafe.R; import android.os.Bundle; import android.app.Activity; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.view.Menu; import android.view.Window; import android.view.WindowManager; import android.view.animation.AlphaAnimation; import android.widget.LinearLayout; import android.widget.TextView; public class SplashActivity extends Activity { private TextView tv_splash_version; private LinearLayout ll_splash_main; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //取消標題欄 requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.splash); tv_splash_version = (TextView) this.findViewById(R.id.tv_splash_version); ll_splash_main = (LinearLayout) this.findViewById(R.id.ll_splash_main); String versiontext = getVersion(); tv_splash_version.setText(versiontext); /* AlphaAnimation類:透明度變化動畫類 * AlphaAnimation類是Android系統中的透明度變化動畫類,用于控制View對象的透明度變化,該類繼承于Animation類。 * AlphaAnimation類中的很多方法都與Animation類一致,該類中最常用的方法便是AlphaAnimation構造方法。 * * public AlphaAnimation (float fromAlpha, float toAlpha) 參數說明 fromAlpha:開始時刻的透明度,取值范圍0~1。 toAlpha:結束時刻的透明度,取值范圍0~1。 */ AlphaAnimation aa = new AlphaAnimation(0.0f, 1.0f); aa.setDuration(2000); //Animation類的方法,設置持續時間 ll_splash_main.startAnimation(aa); //設置動畫 //完成窗體的全屏顯示 getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.splash, menu); return true; } /** * 獲取當前程序的版本號 * @return */ private String getVersion(){ // 獲取一個PackageManager的實例,從而可以獲取全局包信息 PackageManager manager = getPackageManager(); try { // Retrieve overall information about an application package that is installed on the system. PackageInfo info = manager.getPackageInfo(getPackageName(), 0); // The version name of this package, as specified by the <manifest> tag's versionName attribute. return info.versionName; } catch (Exception e) { e.printStackTrace(); return "版本號未知"; } } } ~~~ ### 相關知識點: 在開發程序是經常會需要軟件全屏顯示、自定義標題(使用按鈕等控件)和其他的需求,今天這一講就是如何控制Android應用程序的窗體顯示. 首先介紹一個重要方法那就是requestWindowFeature(featrueId),它的功能是啟用窗體的擴展特性。參數是Window類中定義的常量。 一、枚舉常量 > 1.DEFAULT_FEATURES:系統默認狀態,一般不需要指定 > 2.FEATURE_CONTEXT_MENU:啟用ContextMenu,默認該項已啟用,一般無需指定 > 3.FEATURE_CUSTOM_TITLE:自定義標題。當需要自定義標題時必須指定。如:標題是一個按鈕時 > 4.FEATURE_INDETERMINATE_PROGRESS:不確定的進度 > 5.FEATURE_LEFT_ICON:標題欄左側的圖標 > 6.FEATURE_NO_TITLE:無標題 > 7.FEATURE_OPTIONS_PANEL:啟用“選項面板”功能,默認已啟用。 > 8.FEATURE_PROGRESS:進度指示器功能 > 9.FEATURE_RIGHT_ICON:標題欄右側的圖標 **效果圖: **default: DEFAULT_FEATURES ![](https://box.kancloud.cn/2016-02-18_56c5a94ee3419.png) progress:FEATURE_PROGRESS:進度指示器功能 ![](https://box.kancloud.cn/2016-02-18_56c5a94f09a4f.png) no title:FEATURE_NO_TITLE:無標題 ![](https://box.kancloud.cn/2016-02-18_56c5a94f24101.png) lefticon:FEATURE_LEFT_ICON:標題欄左側的圖標 ![](https://box.kancloud.cn/2016-02-18_56c5a94f322d8.png) fullscreen: ![](https://box.kancloud.cn/2016-02-18_56c5a94f43bdb.png) indeterminate_progress: FEATURE_INDETERMINATE_PROGRESS:不確定的進度 ![](https://box.kancloud.cn/2016-02-18_56c5a94f57116.png) customtitle:FEATURE_CUSTOM_TITLE:自定義標題。 ![](https://box.kancloud.cn/2016-02-18_56c5a94f66de6.png) AlphaAnimation類是Android系統中的透明度變化動畫類,用于控制View對象的透明度變化,該類繼承于Animation類。AlphaAnimation類中的很多方法都與Animation類一致,該類中最常用的方法便是AlphaAnimation構造方法。 【基本語法】public AlphaAnimation (float fromAlpha, float toAlpha) 參數說明 fromAlpha:開始時刻的透明度,取值范圍0~1。 toAlpha:結束時刻的透明度,取值范圍0~1。 ### 運行 [![image](https://box.kancloud.cn/2016-02-18_56c5a94f7b244.jpg "image")](http://img.blog.csdn.net/20140925143019612) [![image](https://box.kancloud.cn/2016-02-18_56c5a94f8ba54.jpg "image")](http://img.blog.csdn.net/20140925143020673) 運行效果: [![Screenshot_2014-09-25-14-32-55](https://box.kancloud.cn/2016-02-18_56c5a94fabeb7.jpg "Screenshot_2014-09-25-14-32-55")](http://img.blog.csdn.net/20140925143206534)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看