隐藏应用程序启动器图标,标题栏,当活动开始的机器人启动器、机器人、应用程序、图标

2023-09-12 01:58:06 作者:年轻就是资本

我已经搜查左右,但没有发现类似的问题,因为我不知道如何结束其在一个句子里。我使用ActionBarSherlock,有一个标志,而不是启动器图标(即的72x72图标),在活动的右上角文字。

当的活性负载首次,用于第二的一小部分。我看到清单(如下)所定义的启动器图标和标签,操作栏出现的标志前。这家活动非常简单,所以它没有做任何额外的负载可能导致延迟。

 <应用
    机器人:hardwareAccelerated =真
    机器人:图标=@可绘制/ launcher_icon
    机器人:标签=@字符串/ APP_NAME
    机器人:screenOrientation =画像>

    <活动
        机器人:名称=。SplashScreenActivity
        机器人:标签=@字符串/ APP_NAME
        机器人:标志=@可绘制/ ab_logo
        机器人:主题=@安卓风格/ Theme.Light.NoTitleBar>
        <意向滤光器>
            <作用机器人:名称=android.intent.action.MAIN/>

            <类机器人:名称=android.intent.category.LAUNCHER/>
        &所述; /意图滤光器>
    < /活性GT;

    <活动
        机器人:HomeActivityNAME =
        机器人:标签=@字符串/ homeitle
        机器人:标志=@可绘制/ ab_logo
        机器人:主题=@风格/ MyTheme的>
    < /活性GT;

 < /用途>
 

我可以让文本消失,由它的造型是相同的颜色作为背景,但我不能找到一种方法,以消除/隐藏该活动的启动器图标。

我有设置一个启动画面的活动(如在清单上面),这只是加载我家的活动,其中出现问题。这确实有帮助,但有时加载活动时,仍然出现该问题。

 公共类SplashScreenActivity扩展活动
{
   @覆盖
   公共无效的onCreate(包savedInstanceState)
   {
        super.onCreate(savedInstanceState);
   }

   @覆盖
   公共无效onResume()
   {
       super.onResume();
       意图I =新的意图(getBaseContext(),HomeActivity.class);
       startActivity(ⅰ);
       完();
   }
}
 
ActiveDock for Mac 应用程序启动器

有谁知道的一种方式来隐藏启动器图标和放大器;标题标签,因此,它并没有前ActionBarSherlock显示正在显示?理想的情况是这样一个闪屏是不需要的,因为有几个方式可以访问这将避免上面显示的启动画面的活动。

---更新我的主题文件----

 <样式名称=MyTheme的父=Theme.Sherlock.ForceOverflow>
    <项目名称=机器人:windowBackground> @色/白< /项目>
    <项目名称=机器人:actionBarStyle> @风格/ MyTheme.ActionBar< /项目>
    <项目名称=机器人:actionMenuTextColor> @色/白< /项目>
    <项目名称=actionBarStyle> @风格/ MyTheme.ActionBar< /项目>
    <项目名称=actionMenuTextColor> @色/白< /项目>
< /风格>

<样式名称=MyTheme.ActionBar父=Widget.Sherlock.Light.ActionBar.Solid.Inverse>
    <项目名称=机器人:背景> @色/蓝< /项目>
    <项目名称=机器人:titleTextStyle> @风格/ MyTheme.ActionBar.TitleTextStyle< /项目>
    <项目名称=机器人:displayOptions> showHome | useLogo< /项目>
    <项目名称=displayOptions> showHome | useLogo< /项目>
    <项目名称=背景> @色/蓝< /项目>
    <项目名称=titleTextStyle> @款式/ MyTheme.ActionBar.TitleTextStyle< /项目>
< /风格>

<样式名称=MyTheme.ActionBar.TitleTextStyle父=@安卓风格/ TextAppearance>
    <项目名称=机器人:文字颜色> @色/蓝< /项目>
< /风格>
 

解决方案

通过添加图标的风格,这是一样的标识固定它。这将覆盖启动器图标。

 <样式名称=MyTheme.ActionBar父=Widget.Sherlock.Light.ActionBar.Solid.Inverse>
      <项目名称=机器人:背景> @色/ infostop_blue< /项目>
      <项目名称=机器人:titleTextStyle> @风格/ MyTheme.ActionBar.TitleTextStyle< /项目>
      <项目名称=机器人:displayOptions> showHome | useLogo< /项目>
      <项目名称=displayOptions> showHome | useLogo< /项目>
      <项目名称=机器人:图标> @可绘制/ ab_logo< /项目>
      <项目名称=图标> @可绘制/ ab_logo< /项目>
      <项目名称=背景> @色/蓝< /项目>
      <项目名称=titleTextStyle> @款式/ MyTheme.ActionBar.TitleTextStyle< /项目>
    < /风格>
 

I've searched SO but not found similar questions as I'm not sure how to phase it in a sentence. I am using ActionBarSherlock, with a logo instead of the launcher icon (i.e. 72x72 icon) with text in the top corner of the activity.

When the activity loads for the first time, for a fraction of a second. I see the launcher icon and label defined in the manifest (as below), before the action bar appears with the logo. This home activity is very simple, so its not doing any additional loading which could cause a delay.

<application
    android:hardwareAccelerated="true"
    android:icon="@drawable/launcher_icon"
    android:label="@string/app_name"
    android:screenOrientation="portrait" >

    <activity
        android:name=".SplashScreenActivity"
        android:label="@string/app_name"
        android:logo="@drawable/ab_logo"
        android:theme="@android:style/Theme.Light.NoTitleBar" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <activity
        android:name=".HomeActivity"
        android:label="@string/homeitle"
        android:logo="@drawable/ab_logo"
        android:theme="@style/MyTheme" >
    </activity>

 </application>

I can make the text "disappear" by styling it to be the same colour as the background, but i cant find a way to remove/hide the launcher icon from the activity.

I have setup a splashscreen activity (as in manifest above), which just loads my home activity where the issue occurs. This does help, but sometimes the issue still occurs when loading the activity.

public class SplashScreenActivity extends Activity
{
   @Override
   public void onCreate(Bundle savedInstanceState)
   {
        super.onCreate(savedInstanceState);
   }

   @Override
   public void onResume()
   {
       super.onResume();
       Intent i = new Intent(getBaseContext(), HomeActivity.class);
       startActivity(i);
       finish();
   }
}

Does anyone know of a way to hide the launcher icon & title label, so that it doesn't show up prior to ActionBarSherlock being displayed? Ideally so a splash screen is not needed, as there are several ways to access the activity which would avoid the splashscreen shown above.

--- Update My Theme File ----

   <style name="MyTheme" parent="Theme.Sherlock.ForceOverflow">
    <item name="android:windowBackground">@color/white</item>
    <item name="android:actionBarStyle">@style/MyTheme.ActionBar</item>
    <item name="android:actionMenuTextColor">@color/white</item>
    <item name="actionBarStyle">@style/MyTheme.ActionBar</item>
    <item name="actionMenuTextColor">@color/white</item>
</style>

<style name="MyTheme.ActionBar" parent="Widget.Sherlock.Light.ActionBar.Solid.Inverse">
    <item name="android:background">@color/blue</item>
    <item name="android:titleTextStyle">@style/MyTheme.ActionBar.TitleTextStyle</item>
    <item name="android:displayOptions">showHome|useLogo</item>
    <item name="displayOptions">showHome|useLogo</item>
    <item name="background">@color/blue</item>
    <item name="titleTextStyle"> @style/MyTheme.ActionBar.TitleTextStyle</item>
</style>

<style name="MyTheme.ActionBar.TitleTextStyle" parent="@android:style/TextAppearance">
    <item name="android:textColor">@color/blue</item>
</style>

解决方案

Fixed it by adding icon to the style, which is the same as the logo. This overrides the launcher icon.

    <style name="MyTheme.ActionBar" parent="Widget.Sherlock.Light.ActionBar.Solid.Inverse">
      <item name="android:background">@color/infostop_blue</item>
      <item name="android:titleTextStyle">@style/MyTheme.ActionBar.TitleTextStyle</item>
      <item name="android:displayOptions">showHome|useLogo</item>
      <item name="displayOptions">showHome|useLogo</item>
      <item name="android:icon">@drawable/ab_logo</item>
      <item name="icon">@drawable/ab_logo</item>
      <item name="background">@color/blue</item>
      <item name="titleTextStyle"> @style/MyTheme.ActionBar.TitleTextStyle</item>
    </style>