我的基于桌面的WPF应用程序(4.0)与DB一起使用,为此,它应该在应用程序的启动时与SQL Server建立连接.当然,这个操作需要一些时间,用户必须等待几秒钟(3-5),同时.Net Framework启动并连接到SQL Server.
在这种情况下,我决定使用闪屏.我在解决方案中添加了一些图片,将构建操作设置为"启动画面",编译了我的应用程序,它的工作原理!如果连接到SQL Server的尝试失败(例如服务器不可用),我的应用程序会抛出异常并向用户显示MessageBox警告和异常详细信息,用户按OK和应用程序关闭(Application.Current.Shutdown()).
在我添加启动画面之前,所有这些逻辑用于完美地工作,但是现在,添加了启动画面,如果我在SQL Server不可用时运行应用程序,应用程序会抛出异常(正如我在我的代码中提到的那样),但是MessageBox出现了通知1-2秒并且在没有任何用户交互的情况下消失,用户甚至无法读取其上写的内容.
我发现,如果我尝试显示2 MessagBoxes,那么第一个将立即出现并消失,但第二个将保持到用户将按OK.
我的问题是:如何解决这个问题?我想使用启动画面并MessageBox在抛出异常时显示一个并让用户决定何时关闭它(用户单击"确定"按钮).
这是一个描述我的应用程序逻辑的流程图:
没有例外(好的场景):运行应用程序→启动画面if(isConnectedToSQL=true)→→显示主窗口...
有异常(错误情况):运行应用程序→启动屏幕→→ if(isConnectedToSQL=false)抛出异常→显示带有异常详细信息的消息框→用户单击确定→关闭应用程序.
我已经设法取消选中Xcode 4'在Xcode启动时显示此屏幕'复选框,我想再次回来.这是如何实现的?我在用户首选项中看不到任何内容,在Xcode 4文档中也没有任何引用 - 除了'启动一个新项目'.此外,Google上似乎没有任何现有问题.如果有人知道重新启用复选框的位置 - 请告诉我.再次感谢.VV
C#WPF应用程序
我通过使用在启动时显示SplashScreen最少的时间
Thread.Sleep(int); //int = milliseconds to display splash screen
Run Code Online (Sandbox Code Playgroud)
达到该睡眠时间后,代码将恢复,并且SplashScreen将逐渐淡出以关闭
SplashScreen.Close(Timespan.FromMilliseconds(int)); //int = milliseconds fade-out
Run Code Online (Sandbox Code Playgroud)
我想在此时暂停等待SplashScreen变为100%透明并完全关闭,然后继续执行其他任务,IE写入控制台或显示MainWindow.
(TimeSpan.FromMilliseconds(int))完成时是否触发了事件?还有其他建议吗?
namespace StartupSplash
{
public class SplashScreenStartup
{
//IMPORTANT:set image property to Resource and NOT Splash Screen
private SplashScreen Splash = new SplashScreen("Resources/SplashScreen.png");
public void SplashScreenStartUp()
{
Splash.Show(false, true);
Thread.Sleep(3000); // Pause code, display splash screen 3 seconds
Splash.Close(TimeSpan.FromMilliseconds(3000)); // 3 second splash fade-out
// I want to wait until splash screen fadeOut has completed before
// this next console output …Run Code Online (Sandbox Code Playgroud) 大家好,我是Java的新手,并试图使闪屏或图像显示3秒钟.然后它会进入我的主程序.有没有人有想法如何做到这一点或可以链接到任何教程?
到目前为止,我已经做到了这一点,但不知道从哪里开始.
public static void main(String[] args)
{
splashInit(); // initialize splash overlay drawing parameters
appInit(); // simulate what an application would do
}
Run Code Online (Sandbox Code Playgroud) 我有启动画面= 2208 x 2208.和应用程序图标192 X 192.我正在使用,ionic1但我仍然运行命令作为ionic cordova resource命令生成应用程序图标和启动画面.
在Android中,它运行良好.但是当我为iOS做的时候,它会抛出这个错误:
错误:遇到https://res.ionic.io/api/v1/transform body的错误状态代码(400):{"错误":"源图像2208x2208对于Default-Landscape@~ipadpro.png来说太小了,需要在至少2732x2048源文件"}
我不知道它是什么问题.我将启动画面设置为正确的尺寸,但我不知道为什么它不能用于iOS.
我可以更新我的离子版本来完成我的应用程序的重新工作.
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
<preference name="orientation" value="portrait" />
<icon height="57" src="resources/ios/icon/icon.png" width="57" />
<icon height="114" src="resources/ios/icon/icon@2x.png" width="114" />
<icon height="40" src="resources/ios/icon/icon-40.png" width="40" />
<icon height="80" src="resources/ios/icon/icon-40@2x.png" width="80" />
<icon height="120" src="resources/ios/icon/icon-40@3x.png" width="120" />
<icon height="50" src="resources/ios/icon/icon-50.png" width="50" />
<icon height="100" src="resources/ios/icon/icon-50@2x.png" width="100" />
<icon height="60" src="resources/ios/icon/icon-60.png" width="60" />
<icon height="120" src="resources/ios/icon/icon-60@2x.png" width="120" />
<icon height="180" src="resources/ios/icon/icon-60@3x.png" width="180" …Run Code Online (Sandbox Code Playgroud) 当我构建iOS应用程序时,它在Macbook的模拟器中完美打开。当我在iTunes商店上发布该应用程序时,该应用程序不再起作用。初始屏幕已显示,但停留在屏幕上。
我需要知道有没有什么方法可以在闪屏期间执行任务在颤动中可见。我知道如何在 flutter 中添加闪屏,但我不知道如何在闪屏可见期间执行后台操作。我在网上找不到任何东西,请帮忙。
Pyinstaller 最近添加了一个启动画面选项(耶!),但启动画面在 exe 运行的整个过程中保持打开状态。我需要它,因为我的文件打开速度非常慢,我想警告用户不要关闭窗口。有没有办法让 gui 打开时关闭启动屏幕?
我正在尝试实现启动画面。
我按照闪屏 API 方法实现了
implementation 'androidx.core:core-splashscreen:1.0.0-alpha02'
启动文件
<style name="Theme.App.Start" parent="Theme.SplashScreen">
<item name="windowSplashScreenBackground">#FFF</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_baseline_baby_changing_station_24</item>
<item name="postSplashScreenTheme">@style/Theme.SplashScreenApi</item>
</style>
Run Code Online (Sandbox Code Playgroud)
splash.xml(用于暗模式)
<style name="Theme.App.Start" parent="Theme.SplashScreen">
<item name="windowSplashScreenBackground">#3A3A3A</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_baseline_baby_changing_station_24</item>
<item name="postSplashScreenTheme">@style/Theme.SplashScreenApi</item>
</style>
Run Code Online (Sandbox Code Playgroud)
清单.xml
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.App.Start">
<activity
android:name=".MainActivity"
android:exported="true"
android:theme="@style/Theme.App.Start">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Run Code Online (Sandbox Code Playgroud)
MainActivity.kt
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
installSplashScreen()
setContentView(R.layout.activity_main)
}
}
Run Code Online (Sandbox Code Playgroud)
深色模式下仍显示黑色图标

并且在灯光模式下完美工作

设备名称:小米红米 Note 7 Pro,
Android 版本:Android 10 (SDK 29)
我想在应用程序加载/初始化时显示进度条。
该代码不起作用,但应该让您了解我想要完成的任务。
my Bool $done-compiling = False;
BEGIN {
start repeat {
print '*';
sleep 0.33;
} until $done-compiling;
};
INIT {
$done-compiling = True;
};
Run Code Online (Sandbox Code Playgroud)
是否触发了我可以在 BEGIN 块中响应的事件?
splash-screen ×10
c# ×2
flutter ×2
wpf ×2
.net ×1
android ×1
android-12 ×1
awt ×1
cordova ×1
ios ×1
java ×1
progress-bar ×1
pyinstaller ×1
python ×1
raku ×1
startup ×1
swing ×1
timespan ×1
xcode4 ×1