繁体   English   中英

按日期更改启动画面图像

[英]Change the splashscreen imagem by the date

我正在尝试创建一个在特定日期临近时更改启动画面图像的函数,例如:

30/nov/2017 - Default splashscreen

01/des/2017 ~ 31/des/2017 - Christmas theme splashscreen

01/jan/2018 - Default splashscreen

我创建了初始屏幕,将SplashScreen-Image: splashdemo/splash.png放在manifest.mf-splash:src/splashdemo/splash.pngProperties > Run > VM Options -splash:src/splashdemo/splash.png放入其中。

我主要是这样的:

package splashdemo;

public class Splashdemo {

    public static void main(String[] args) throws InterruptedException {
        Thread.sleep(2000);
    }
}

闪屏可以正常工作,但是现在我想以某种方式更改图像。 我怎样才能做到这一点?

目前,您的方法依赖于每次日期范围更改时重新发布应用程序。

我建议您将三个图像打包到jar中,然后根据日期动态确定启动屏幕名称,然后使用正确的图像直接调用SplashScreen类。

看到这些链接

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM