2013-12-16 25 views
2

在我正在開發的應用程序中,我正在實施一個啓動畫面此啓動畫面位於應用程序的開始處。當啓動splashscreen時,action bar可以在半秒鐘內看到,然後消失。我不知道爲什麼會發生這種情況。任何人都可以幫助我解決這個問題。我在manifest file中實現了以下代碼。Android Splashscreen - 動作欄過一會並消失

<activity 
     android:name="com.example.trycatch.SplashscreenActivity" 
     android:label="@string/app_name" 
     android:theme="@android:style/Theme.NoTitleBar.Fullscreen" 
     android:noHistory = "true" 
     android:screenOrientation="portrait"> 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 
     </intent-filter> 
    </activity> 

及以下的活動文件片段

@Override 
protected void onResume() { 

     setContentView(R.layout.splashscreen); 
    super.onResume(); 
} 

任何人都可以請幫助我。謝謝你的時間。

PS:我使用sherlock actionbar

+0

刪除'機器人:主題= 「@安卓風格/ Theme.NoTitleBar.Fullscreen」'從清單文件 –

+0

感謝您的。我做到了。這使得操作欄出現在閃屏中。 –

+0

你想要操作欄顯示與否? –

回答

2

使用活動中的下列代碼(這意味着在你的java文件)的setContentView()之前

requestWindowFeature(Window.FEATURE_NO_TITLE); 
0

在您的Android清單文件中添加此

<activity 
      android:name="com.example.abc.SplashScreen" 
      android:label="@string/app_name" 
      android:theme="@style/Theme.Sherlock.NoActionBar" ></activity> 
0

使用以下代碼消失操作欄:

public void onCreate(Bundle savedInstanceState) { 
super.onCreate(savedInstanceState); 
getWindow().requestFeature(Window.FEATURE_ACTION_BAR); 
getActionBar().hide(); 

setContentView(R.layout.splash); 

info