如何在Android中制作真正的启动画面?我不想要定时器或延迟.只是在您的应用程序加载之前显示的启动画面.
好的,在iOS中模拟启动视频的选项很少.我们所能做的就是等到应用程序完全加载,然后创建Media Player并在其中加载视频.
我用以下代码实现了它:
-(void) moviePlayBackDidFinish:(NSNotification*)notification
{
NSLog(@"Intro video stopped");
[mMoviePlayer release];
}
- (void)applicationDidFinishLaunching:(UIApplication *)application {
NSURL* mMovieURL;
NSBundle *bundle = [NSBundle mainBundle];
if(bundle != nil)
{
NSString *moviePath = [bundle pathForResource:@"intro" ofType:@"mp4"];
if (moviePath)
{
mMovieURL = [NSURL fileURLWithPath:moviePath];
[mMovieURL retain];
}
}
mMoviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:mMovieURL];
[mMovieURL release];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlayBackDidFinish:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:mMoviePlayer];
mMoviePlayer.controlStyle = MPMovieControlStyleNone;
[mMoviePlayer.backgroundView addSubview:[[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Splash/background.png"]] autorelease]];
mMoviePlayer.scalingMode = MPMovieScalingModeFill;
[window addSubview:mMoviePlayer.view];
[mMoviePlayer setFullscreen:YES animated:NO];
[window makeKeyAndVisible];
[mMoviePlayer play];
<... other …Run Code Online (Sandbox Code Playgroud) Cordova保留两组初始图像,一组在ProjectName/Resources/splash中,另一组在www/res/screen/ios中.为什么这样,为什么不为所有东西使用相同的套装?www/res/screen/ios中的内容是什么?
我一直在这里看一些关于这个问题的不同帖子,没有什么能解决我的问题.
在我的启动画面加载并显示约2秒后,会出现一个白色屏幕,显示约2秒钟,然后显示应用程序内容.
此问题仅存在于iOS上,并且仅在我使用iOS 6.1和7在3.5"上运行模拟器时才存在.
我有
<preference name="AutoHideSplashScreen" value="false" />
Run Code Online (Sandbox Code Playgroud)
所以我可以手动控制启动屏幕何时隐藏在deviceready事件中:
function onDeviceReady() {
setTimeout(function () {navigator.splashscreen.hide()},2000);
//more stuff
}
Run Code Online (Sandbox Code Playgroud)
问题是,这并不能阻止防溅板过早隐藏.我看到完全相同的行为,除了加载微调器在2000年后消失.
那么......到底是怎么回事?
这个问题在过去曾被问过,但我找到的答案都没有为我解决问题.
我正在尝试制作一个非常简单的phonegap应用程序来显示启动画面,并在它准备好时宣布.它只是一个测试应用程序,可以解决如何使用启动画面.
我有一个www文件夹config.xml.所有的防溅板都在里面www/res/screen/<platform>/filename.png
我的配置文件是
<?xml version='1.0' encoding='utf-8'?>
<widget id="uk.co.workshop14.splashscreen-example-app" version="0.1.0" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0">
<name>splashscreen-example-app</name>
<description>
Hello World sample application that responds to the deviceready event.
</description>
<author email="support@phonegap.com" href="http://phonegap.com">
Peter
</author>
<preference name="permissions" value="none" />
<preference name="phonegap-version" value="3.5.0" />
<preference name="orientation" value="default" />
<preference name="target-device" value="universal" />
<preference name="fullscreen" value="true" />
<preference name="webviewbounce" value="true" />
<preference name="prerendered-icon" value="true" />
<preference name="stay-in-webview" value="false" />
<preference name="ios-statusbarstyle" value="black-opaque" />
<preference name="detect-data-types" value="true" />
<preference name="exit-on-suspend" value="false" …Run Code Online (Sandbox Code Playgroud) 在我的第一个Ionic项目上工作.
我对启动画面没有任何问题 - 我可以使用CordovaSplashscreen插件并告诉它隐藏()当相关的承诺解决; 我也可以注释掉隐藏,而只是依赖于在config.xml中使用AutoHideSplashScreen,并且在SplashScreenDelay之后让启动画面自动隐藏.
(我列出这些事情,做工作,所以很显然,我的问题是不是几十离子和科尔多瓦/的重复PhoneGap的相关闪屏的问题.)
我的问题是,无论我尝试什么 - ios,android,模拟器,真实设备,使用CordovaSplashscreen隐藏()或不,AutoHideSplashScreen设置为true,AutoHideSplashScreen设置为false等 - 我无法得到启发屏幕在消失时消失.
无论config.xml设置,splash screen hide()调用或不调用,仿真或设备,ios或我使用的是什么组合,FadeSplashScreen似乎都没有任何影响.
我当前的config.xml设置,虽然这并没有提供我尝试过的十几个这些值的完整描述:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<widget id="com.ionicframework.yourkids381244" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
... other code at same level of hierarchy omitted ...
<preference name="SplashScreen" value="screen"/>
<preference name="AutoHideSplashScreen" value="false"/>
<preference name="auto-hide-splash-screen" value="false"/>
<preference name="ShowSplashScreenSpinner" value="false"/>
<preference name="SplashScreenDelay" value="10000"/>
<preference name="FadeSplashScreen" value="true"/>
<preference name="FadeSplashScreenDuration" value="3.0"/>
... other code at same level of hierarchy omitted ...
</widget>
Run Code Online (Sandbox Code Playgroud)
来自我的app.js路由的代码执行hide(),但是,这似乎不是问题的一部分; 它工作,我通过注释hide()行并将AutoHideSplashScreen设置为false来确认,这成功地导致启动屏幕永远不会隐藏; 但是从那个状态,我无法隐藏淡出闪屏,无论是通过取消注释hide()行来隐藏使用CordovaSplashscreen,还是将AutoHideSplashScreen设置为true.
.state('app.main', {
url: "/main",
views: {
'menuContent': …Run Code Online (Sandbox Code Playgroud) 我在iOS 11上遇到了与Splash屏幕相关的奇怪问题.我使用的是LaunchScreen.storyboard.我将Splash Image更改为Xcode 9,但是当我在iOS 11上启动设备时,显示了旧的Splash图像,我从iPhone 7中删除了应用程序,然后重新启动,Splash Image仍旧.我重新启动了iPhone,然后显示新的启动图像,我读到这个问题,解决这个问题的方式在这里.我做TestFlight建立测试人员,他们也显示旧的闪屏,如果测试人员仍然可以重新启动设备,但我们不能要求用户重新启动他们的设备,使他们能够看到新的启动画面.我该如何解决?
更新:重命名Splash Image不会给出任何结果.在iOS 10上,始终显示新的Splash图像,这是正确的行为.
更新1:我删除LaunchScreen.storyboard,创建了一个新的安装isInitialViewController属性,UIImageView启动后设置和图像,没有显示启动画面,只是一个白色的屏幕(如果您设置UIImageView背景颜色将显示任何颜色).我的意见是,好像新的Splash屏幕没有安装到特定目标,因为这是一个问题.但是如何在Assets.xcassets中完成?主要问题仍然是相同的 - 我该如何解决?
如何在启动画面中添加一些文本?我的启动画面不是一个单独的活动,我不想把它作为标准活动。
我按照这篇文章创建了它:https : //android.jlelse.eu/launch-screen-in-android-the-right-way-aca7e8c31f52
可以添加一些文字吗?
我确实需要支持基于故事板的启动屏幕和项目中的"传统"启动图像.
添加启动屏幕故事板并UIImageView指向启动屏幕似乎是一种直接的方式.但是,Interface Builder无法找到启动映像,也无法显示它.
由于所有尺寸的内容也不同,故事板是否会选择正确的图像?
用尺寸类和约束重建图像是不可能的,所以
TL; DR:如何使用启动故事板使用发布屏幕图像集中的相应图像?
splash-screen ×10
cordova ×4
ios ×4
android ×3
iphone ×2
default.png ×1
ionic ×1
ios11 ×1
ipad ×1
ipod ×1
jquery ×1
launchimage ×1
uiimageview ×1
uistoryboard ×1