Android啟動(dòng)畫面的實(shí)現(xiàn)方法
本文實(shí)例講述了Android啟動(dòng)畫面的實(shí)現(xiàn)方法。分享給大家供大家參考。具體分析如下:
在應(yīng)用程序中經(jīng)常用到啟動(dòng)畫面,會(huì)啟動(dòng)一個(gè)后臺(tái)線程為主程序的運(yùn)行準(zhǔn)備資源。
Android要實(shí)現(xiàn)啟動(dòng)畫面可以這樣做:
這是splash.xml布局文件的代碼:
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="fill_parent" android:layout_width="fill_parent" android:orientation="vertical">
<ImageView android:layout_height="fill_parent" android:layout_width="fill_parent" android:scaleType="fitCenter" android:src="@drawable/splash"></ImageView>
</LinearLayout>
放一個(gè)ImageView加載啟動(dòng)畫面圖片
SplashActivity作為主視圖啟動(dòng):
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
Handler x = new Handler();
x.postDelayed(new splashhandler(), 2000);
}
class splashhandler implements Runnable{
public void run() {
startActivity(new Intent(getApplication(),MainActivity.class));
SplashActivity.this.finish();
}
}
希望本文所述對(duì)大家的Android程序設(shè)計(jì)有所幫助。
- 如何正確實(shí)現(xiàn)Android啟動(dòng)屏畫面的方法(避免白屏)
- Android編程之簡(jiǎn)單啟動(dòng)畫面實(shí)現(xiàn)方法
- Android簡(jiǎn)單實(shí)現(xiàn)啟動(dòng)畫面的方法
- Android編程中調(diào)用Camera時(shí)預(yù)覽畫面有旋轉(zhuǎn)問題的解決方法
- Android開機(jī)畫面的具體修改方法
- android Socket實(shí)現(xiàn)簡(jiǎn)單聊天功能以及文件傳輸
- 詳解Android——藍(lán)牙技術(shù) 帶你實(shí)現(xiàn)終端間數(shù)據(jù)傳輸
- Android實(shí)時(shí)獲取攝像頭畫面?zhèn)鬏斨罰C端思路詳解
相關(guān)文章
Android UI設(shè)計(jì)系列之HTML標(biāo)簽實(shí)現(xiàn)TextView設(shè)置中文字體加粗效果(6)
這篇文章主要介紹了Android UI設(shè)計(jì)系列之使用HTML標(biāo)簽,實(shí)現(xiàn)在TextView中對(duì)中文字體加粗的效果,具有一定的實(shí)用性和參考價(jià)值,感興趣的小伙伴們可以參考一下2016-06-06深入Android 五大布局對(duì)象的應(yīng)用
本篇文章小編為大家介紹,深入Android 五大布局對(duì)象的應(yīng)用。需要的朋友參考下2013-04-04Android中FlowLayout組件實(shí)現(xiàn)瀑布流效果
大家好,本篇文章主要講的是Android中FlowLayout組件實(shí)現(xiàn)瀑布流效果,感興趣的同學(xué)趕快來看一看吧,對(duì)你有幫助的話記得收藏一下2022-01-01AndroidStudio重新share代碼和上傳到svn新地址教程
這篇文章主要介紹了AndroidStudio重新share代碼和上傳到svn新地址教程,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧2020-04-04Android studio button 按鈕 四種綁定事件的方法【實(shí)例代碼】
這篇文章主要介紹了Android studio button 按鈕 四種綁定事件的方法,非常不錯(cuò),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2018-08-08詳解Android數(shù)據(jù)存儲(chǔ)之SQLCipher數(shù)據(jù)庫加密
對(duì)于已經(jīng)ROOT的手機(jī)來說的沒有任何安全性可以,一旦被利用將會(huì)導(dǎo)致數(shù)據(jù)庫數(shù)據(jù)的泄漏,本篇文章主要介紹了Android數(shù)據(jù)存儲(chǔ)之SQLCipher數(shù)據(jù)庫加密,具有一定的參考價(jià)值,有需要的可以了解一下。2016-12-12