标签: splash-screen

我的Android启动画面应该是什么分辨率?

我正在创建一个启动画面,在我的Android应用程序加载时会显示.我想以正确的大小创建它,以便Android不会自动向上或向下自动缩放以适应屏幕.(这是一个位图图片,一幅油画的照片,所以我不能把它变成九个补丁.)

但我至少有三种重要的屏幕尺寸:320x480,480x854(Droid)和480x800(Nexus One).

我已经阅读了有关支持多种屏幕尺寸的文档,但我仍然没有看到我应该如何为Droid/Nexus配置不同的启动屏幕(就Android而言,它们都是"hdpi"资源) ,我不知道在任何情况下我的闪屏应该有多大.(Droid的操作系统标题栏/菜单有多高?N1?)

我应该以多大的尺寸制作这些图像,如何告诉Android在给定的屏幕上使用正确的尺寸?

android resolution splash-screen

30
推荐指数
2
解决办法
4万
查看次数

Android:如何在新的 SplashScreen API 中将可绘制对象设置为 windowSplashScreenBackground 参数?

我想使用Splash Screen API制作带有渐变背景和徽标的启动屏幕

像这样:

在此输入图像描述

我对值是纯色的字段进行了样式设置windowSplashScreenBackground,效果很好:

<style name="Theme.MyApp.SplashScreen" parent="Theme.SplashScreen">
    <item name="windowSplashScreenBackground">@color/blue</item>
    <item name="windowSplashScreenAnimatedIcon">@mipmap/ic_launcher</item>
    <item name="postSplashScreenTheme">@style/Theme.MyApp</item>
</style>
Run Code Online (Sandbox Code Playgroud)

该属性windowSplashScreenBackground只能采用颜色。

有什么想法如何创建渐变背景吗?可能是这样的:

 <style name="Theme.MyApp.SplashScreen" parent="Theme.SplashScreen">
    ... 
    <item name="windowSplashScreenBackground">@drawable/gradient_splash_screen_background</item>
    ...
</style>
Run Code Online (Sandbox Code Playgroud)

更新

我还尝试在字段中声明背景android:windowBackground而不是windowSplashScreenBackground

<style name="Theme.MyApp.SplashScreen" parent="Theme.SplashScreen">
    <item name="android:windowBackground">@drawable/gradient_splash_screen_background</item>
<!--        <item name="windowSplashScreenBackground">@color/purple</item>-->
<!--        <item name="windowSplashScreenBackground">@drawable/splash_screen_layers</item>-->
    <item name="windowSplashScreenAnimatedIcon">@mipmap/ic_launcher</item>
    <item name="postSplashScreenTheme">@style/Theme.MyApp</item>
</style>
Run Code Online (Sandbox Code Playgroud)

但它解决了一个问题并消耗了另一个问题。屏幕背景接受渐变但徽标变得不可见

android splash-screen android-theme

30
推荐指数
2
解决办法
2万
查看次数

Splash屏幕之前的黑屏出现在android中

我们知道,当应用程序做一些漫长的过程,比如从互联网上下载一些信息时,它可能会在加载应用程序之前显示启动画面,当应用程序完全加载时,它将显示主页面.在启动画面活动中,我们必须在线程中加载长进程,以避免在加载应用程序之前显示黑屏.我做了所有这些.但在显示应用程序之前还会出现黑屏.这是启动画面活动的onCreate方法:

    protected override void OnCreate (Bundle bundle)
    {
        try {
            base.OnCreate (bundle);
            //_dt = DateTime.Now.AddSeconds (_splashTime);
            SetContentView (Resource.Layout.Splash );
            FirstLoadPB= FindViewById <ProgressBar >(Resource .Id.FirstLoadPB );
            FirstLoadingInfo= FindViewById <TextView >(Resource .Id.FirstLoadInfo );
            LoadApplication ();

        } catch (System.Exception ex) {

            Common.HandleException (ex);
        }
    }
Run Code Online (Sandbox Code Playgroud)

这是LoadApplication方法的代码:

public void LoadApplication()
    {
        new System.Threading.Thread (new ThreadStart (() =>
                                                      {
        //Some Codes to load applications- Downloading from web and accessing the storage(Because was many codes - about 100 line- i was clear them.

        } …
Run Code Online (Sandbox Code Playgroud)

android splash-screen xamarin.android

28
推荐指数
3
解决办法
3万
查看次数

在Android应用程序的webview中加载URL时启动屏幕

我有一个应用程序,它有2个活动,第一个启动第二个将URL加载到webview中.

它工作正常,但是当网址加载时,webview显示为空...然后我想制作一个启动画面或类似的东西,在网址加载时显示它,我在新的活动中做了,但我不知道当网址被加载时,我不知道如何关闭第三个活动...请有人帮助我吗?

这是我的代码......谢谢!

public class Visor extends  Activity {

    WebView mWebView;
    int Result;

    @Override
    public void onCreate (Bundle savedInstanceState){
        super.onCreate(savedInstanceState);
        setContentView(R.layout.visor);
        Bundle extras=getIntent().getExtras();
        String s= extras.getString("url");

        mWebView = (WebView) findViewById(R.id.webview);
        mWebView.getSettings().setJavaScriptEnabled(true);
        mWebView.getSettings().setPluginsEnabled(true);
        mWebView.getSettings().setAllowFileAccess(true);

        mWebView.loadUrl(s);
        mWebView.setWebViewClient(new VisorClient());
        mWebView.getSettings().setBuiltInZoomControls(true);

        }

    private class VisorClient extends WebViewClient {

            @Override
            public void onPageStarted(WebView view, String url, Bitmap favicon) {
                lanzarIntro();
            }
            @Override
            public void onPageFinished(WebView view, String url) {
                mWebView.loadUrl(url);
            }
     }

    public void lanzarIntro(){
        Intent i=new Intent (this, Intro.class);

        startActivity(i);


    }



}
Run Code Online (Sandbox Code Playgroud)

android screen splash-screen webview android-activity

27
推荐指数
2
解决办法
5万
查看次数

飞溅前的空白屏幕

主要问题是2-3秒后出现闪屏.在启动屏幕之前,会出现我不想要的空白布局.否则运行正常.只想删除在启动页面之前出现的空白布局.

主要活动:

public class MainActivity extends Activity {

    private static String TAG = MainActivity.class.getName();
    private static long SLEEP_TIME = 5; // Sleep for some time

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        this.requestWindowFeature(Window.FEATURE_NO_TITLE); // Removes title bar
        this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);  // Removes notification bar

        setContentView(R.layout.activity_main);

        // Start timer and launch main activity
        IntentLauncher launcher = new IntentLauncher();
        launcher.start();
    }

    private class IntentLauncher extends Thread {

        @Override
        /**
         * Sleep for some time and than start new activity.
         */
        public void run() …
Run Code Online (Sandbox Code Playgroud)

android splash-screen

27
推荐指数
6
解决办法
2万
查看次数

Apache Cordova启动画面未在Android中显示

我正在运行Apache Cordova 3.6.3-0.2.13.我试着让启动画面工作.我已经按照http://cordova.apache.org/docs/en/3.6.0/config_ref_images.md.html#Icons%20and%20Splash%20Screens上的文档进行了操作.图标正在运行,但启动画面没有成功.我们还在Cordova之上使用Ionic框架(版本1.2.8).

我做了什么:

从项目根目录为config.xml添加了图标和启动画面:

<preference name="SplashScreen" value="splash"/>
<preference name="SplashScreenDelay" value="10000"/>
<platform name="android">
  <icon src="icons/icon.png"/>

  <!-- you can use any density that exists in the Android project -->
  <splash src="icons/android-splash-land-hdpi.png" density="land-hdpi"/>
  <splash src="icons/android-splash-land-ldpi.png" density="land-ldpi"/>
  <splash src="icons/android-splash-land-mdpi.png" density="land-mdpi"/>
  <splash src="icons/android-splash-land-xhdpi.png" density="land-xhdpi"/>

  <splash src="icons/android-splash-port-hdpi.png" density="port-hdpi"/>
  <splash src="icons/android-splash-port-ldpi.png" density="port-ldpi"/>
  <splash src="icons/android-splash-port-mdpi.png" density="port-mdpi"/>
  <splash src="icons/android-splash-port-xhdpi.png" density="port-xhdpi"/>
</platform>
Run Code Online (Sandbox Code Playgroud)

当然,icons目录存在,文件也就位.当我用ionic run android或构建项目时cordova run android.构建过程还会在platforms/android/res/drawable目录中创建图标和启动画面!

位于的配置文件platforms/android/res/xml/config.xml也正确更新,<preference>并且<icon><splash>元素就位.

我也试过org.apache.cordova.splashscreen插件,也没有成功.我添加了插件 …

android splash-screen cordova

26
推荐指数
3
解决办法
3万
查看次数

Android 12 闪屏 API 定制

自从 Android 在 Android 12 中发布了新的 Splash Screen API 以来,许多应用程序都存在重复的启动屏幕、缺乏自定义等问题。

现在,可以设置背景颜色和中间的图标,但是可以自定义更多吗?由于现在我们只能使用单色背景和不可调整大小的徽标图标,这看起来不太好。

我想要实现的是一个自定义的启动屏幕,带有可绘制的图像作为背景(或包含 2 个项目的图层列表 - 一个背景图像和一个居中徽标),因为它可以在 Android 12 之前使用。

有人成功地实现了这种行为吗?

有一种解决方法可以将 windowIsTranslucent 属性设置为 true 并仅显示第二个启动画面(右侧的启动画面),但它会带来糟糕的用户体验,因为应用程序似乎有几秒钟没有响应。

customization android splash-screen kotlin android-12

25
推荐指数
1
解决办法
7381
查看次数

Android活动背景图片

如何在活动主题/样式中使用背景图像?

如果我使用颜色这样做:

<style name="CustomTheme" parent="android:Theme.Light">
    <item name="android:windowBackground">@color/custom_theme_color</item>
</style>
Run Code Online (Sandbox Code Playgroud)

它工作正常,但如果我用以下代码替换:

<item name="android:windowBackground">@drawable/splash_image</item>
Run Code Online (Sandbox Code Playgroud)

图像显示正确,但所有内容都被压缩到屏幕左上角的一个小块中.状态栏下方的阴影也会被切断或混乱.

我正在使用Mono for Android,图像是一个有效的九补丁png.

android background splash-screen android-manifest xamarin.android

24
推荐指数
4
解决办法
4万
查看次数

启动画面应用程序并隐藏操作栏

我试图弄清楚如何隐藏动态栏以进行启动画面活动.我做了一些在我的启动画面上隐藏我的操作栏的东西,但是有一个问题:在我的启动画面出现之前,有一个活动,其中一个动作栏出现了短暂的...我不知道如何隐藏它!

我的启动画面仅在我们第一次触摸应用程序时出现,就像应用程序的介绍一样.

代码:

package com.example.basicmaponline;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Window;

public class Intro extends Activity{

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);


    getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
    getActionBar().hide();

    setContentView(R.layout.intro);

    Thread timer = new Thread(){
        public void run(){
            try{
                sleep(3000);
            }catch (InterruptedException e) {
                e.printStackTrace();
            }finally{
                Intent openMenu = new Intent("com.example.basicmaponline.MENU");
                startActivity(openMenu);
            }
        }
    };
    timer.start();
}

@Override
protected void onPause() {
    // TODO Auto-generated method stub
    super.onPause();
    finish();
}

}
Run Code Online (Sandbox Code Playgroud)

清单:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" …
Run Code Online (Sandbox Code Playgroud)

user-interface android splash-screen show-hide android-actionbar

23
推荐指数
2
解决办法
4万
查看次数

支持iOS6和iOS7的启动屏幕 - 强制启动屏幕

当谈到启动屏幕时,我找不到一种统一的方式来模仿iOS6和iOS7上的应用程序外观(支持两者).如果我们有工具栏菜单,或者你们有什么好主意如何解决它,我们是否被迫定制一个徽标或类似的闪屏?

splash-screen ios7

23
推荐指数
3
解决办法
4万
查看次数