[003] splash介面,003splash介面

來源:互聯網
上載者:User

[003] splash介面,003splash介面

splash介面的作用:1. 提升產品的知名度2. 應用程式的初始化(載入設定檔,載入工作空間,初始化資料)3. 提升使用者體驗4. 正版驗證5. 線上升級

布局檔案


<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/logo2"    tools:context=".SplashActivity" >    <ImageView        android:id="@+id/iv_splash_logo"        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:layout_alignParentRight="true"        android:layout_alignParentTop="true"        android:src="@drawable/ic_launcher" />    <TextView        android:id="@+id/tv_splash_appname"        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:layout_alignParentRight="true"        android:layout_below="@id/iv_splash_logo"        android:text="@string/app_name"        android:textColor="#000000"        android:textSize="18sp" />    <TextView        android:id="@+id/tv_splash_version"        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:layout_alignParentRight="true"        android:layout_below="@id/tv_splash_appname"        android:text="版本號碼:"        android:textColor="#000000"        android:textSize="18sp" /></RelativeLayout>

SplashActivity.java


package com.itheima.mobilesafe;import android.app.Activity;import android.content.pm.PackageInfo;import android.content.pm.PackageManager;import android.content.pm.PackageManager.NameNotFoundException;import android.os.Bundle;import android.widget.TextView;public class SplashActivity extends Activity{private TextView tv_splash_version;public void onCreate(Bundle savedInstanceState){super.onCreate(savedInstanceState);setContentView(R.layout.activity_splash);tv_splash_version = (TextView) findViewById(R.id.tv_splash_version);tv_splash_version.setText("版本:" + getVersion());}/** * 返回當前應用程式的版本號碼 *  * @return */public String getVersion(){PackageManager pm = getPackageManager();try{PackageInfo packageInfo = pm.getPackageInfo(getPackageName(), 0);return packageInfo.versionName;}catch (NameNotFoundException e){e.printStackTrace();return "";}}}

運行之後的結果




c#做了個啟動介面,啟動介面過後,主視窗被隱藏了

在表單裡喲一個屬性 讓你的表單始終在最上方
 
splash做啟動畫面失真的問題

,可能是VC的圖表編輯器把24位元影像變成256色的了
直接載入位元影像檔案,應該沒有問題
 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.