欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Android 歡迎全屏圖片詳解及實(shí)例代碼

 更新時(shí)間:2017年02月24日 16:09:09   作者:xyTianZhao  
這篇文章主要介紹了Android 歡迎全屏圖片詳解及實(shí)例代碼的相關(guān)資料,需要的朋友可以參考下

Android 歡迎全屏圖片詳解

 其實(shí)歡迎界面就是在主Activity之前再添加一個(gè)歡迎的Activity。在這個(gè)Activity中實(shí)現(xiàn)歡迎界面,和其他的Activity用法
是基本一樣,只有細(xì)微的差別。

    1、在Activity的onCreate方法中實(shí)現(xiàn):

 @Override 
ic void onCreate(Bundle savedInstanceState) { 
super.onCreate(savedInstanceState); 
/**全屏設(shè)置,隱藏窗口所有裝飾**/ 
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, 
    WindowManager.LayoutParams.FLAG_FULLSCREEN); 
/**標(biāo)題是屬于View的,所以窗口所有的修飾部分被隱藏后標(biāo)題依然有效,需要去掉標(biāo)題**/ 
requestWindowFeature(Window.FEATURE_NO_TITLE); 
setContentView(R.layout.main); 

       2、在AndroidManifest.xml文件中的相應(yīng)的歡迎Activity中進(jìn)行配置

<activity 
 android:name=".ActivityDemo" 
 android:label="@string/app_name" 
 android:theme="@android:style/Theme.NoTitleBar"> 
<intent-filter> 
    <action android:name="android.intent.action.MAIN" /> 
    <category android:name="android.intent.category.LAUNCHER" /> 
</intent-filter> 
 </activity> 

 也可以將設(shè)置成Android:theme="@android:style/Theme.NoTitleBar.Fullscreen"(取消頂部的狀態(tài)欄)

    3、歡迎Activity的layout布局文件

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
  android:layout_width="fill_parent" 
  android:layout_height="fill_parent" 
  android:background="@drawable/welcome" 
  android:orientation="vertical" > 
</LinearLayout> 

          上面的android:background="@drawable/welcome"是相對(duì)應(yīng)的圖片資源文件

     4、運(yùn)行結(jié)果如下

感謝閱讀,希望能幫助到大家,謝謝大家對(duì)本站的支持!

相關(guān)文章

最新評(píng)論