如何从操作栏福尔摩斯活动标题,而不从'RecentApps“选择器失去它? [英] How to remove the Activity title from Action Bar Sherlock without losing it from the 'RecentApps' chooser?
问题描述
我有想从我的操作栏福尔摩斯
删除活动标题文本的问题。
我花了(浪费)大量时间试图找到一个解决方案,就是不能使这项工作。
I am having problems trying to remove the Activity title text from my Action Bar Sherlock
.
I have spent(wasted) a lot of time trying to find a solution and just cannot make this work.
我有一个开机活动
上,我去全屏。但就前出现开机活动
,会出现一个画面(的时间很短的时间),有什么,但一个操作栏与应用程序图标
和活动名称
文本。我不明白为什么它出现。这是默认的Android行为?我想避免这个屏幕,或至少删除此屏幕上的操作栏的活动名称。如果我将其设置为,我从最近的应用程序选择器丢失的应用程序。
I have a Splash Activity
on which I go full screen. But just before the Splash Activity
appears, a screen appears (for a very short period of time) that has nothing but an Action Bar with the App Icon
and Activity Title
Text. I do not understand why it appears. Is this default Android behavior? I want to avoid this screen, or at least remove the Activity Title from the Action Bar on this screen. If I set it to "", I lose the app from the Recent Apps chooser.
请参考这些图片:
pre飞溅:
开机画面:
我已经提到了下面的例子对SO和也搜寻其他地方。但似乎没有任何工作。
I have referred to the following examples on SO and also searched elsewhere. But nothing seems to work.
<一个href=\"http://stackoverflow.com/questions/11983120/remove-the-title-text-from-the-action-bar-in-one-single-activity\">Remove从操作杆在一个单一的活动标题文本
<一个href=\"http://stackoverflow.com/questions/7655874/how-do-you-remove-the-title-text-from-the-android-actionbar/7656019#7656019\">How你删除从Android ActionBar中的标题文字?
<一个href=\"http://stackoverflow.com/questions/10417631/how-can-i-remove-title-and-icon-completetly-in-actionbar-sherlock\">How我可以删除标题和动作条福尔摩斯completetly图标?
请查看我的Android清单和主题文件...
Please check my Android Manifest and the theme file...
<application
android:name="com.zipcash.zipcashbetaversion.MyApplication"
android:allowBackup="true"
android:icon="@drawable/zipcash_icon"
android:label="@string/app_name"
android:logo="@drawable/zipcash_logo_small"
android:theme="@style/Theme.MyTheme" >
<activity
android:name="com.zipcash.zipcashbetaversion.SplashActivity"
android:label="@string/app_name"
android:screenOrientation="portrait" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.zipcash.zipcashbetaversion.SignUpActivity"
android:label="@string/title_activity_sign_up"
android:screenOrientation="portrait" >
</activity>
等等...
以下是我的主题文件:
And so on... The following is my theme file:
<style name="Theme.MyTheme" parent="Theme.Sherlock.Light">
<!-- Set style for Action Bar (affects tab bar too) -->
<item name="actionBarStyle">@style/Widget.MyTheme.ActionBar</item>
</style>
<style name="Widget.MyTheme.ActionBar" parent="Widget.Sherlock.ActionBar">
<!-- define background for action bar (sets default for all parts of action bar - main, stacked, split) -->
<item name="android:background">@drawable/background</item>
<item name="background">@drawable/background</item>
<!-- set background for the tab bar (stacked action bar) - it overrides the background property -->
<item name="backgroundStacked">@color/action_bar_tab_background</item>
<item name="titleTextStyle">@style/NoTitleText</item>
<item name="subtitleTextStyle">@style/NoTitleText</item>
<item name="displayOptions">showHome|useLogo</item>
</style>
<style name="NoTitleText">
<item name="android:textSize">0sp</item>
<item name="android:textColor">#00000000</item>
<item name="android:visibility">invisible</item>
</style>
我也写了这个code在我的飞溅活动:
I have also written this code in my Splash Activity:
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayOptions(actionBar.getDisplayOptions() ^ ActionBar.DISPLAY_SHOW_TITLE);
actionBar.hide();
ActivityHelper.initialize(this);
setContentView(R.layout.activity_splash);
我讲,我俯瞰一个错误。有没有别的东西我应该做的。我的最低API级别为8。
Have I made a mistake that I am overlooking. Is there something else I should do. My minimum API level is 8.
任何帮助将AP preciated。
Any help will be appreciated.
推荐答案
您可以添加到您的活动:
You can add this to your activity:
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" >
这篇关于如何从操作栏福尔摩斯活动标题,而不从'RecentApps“选择器失去它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!