景观和肖像的不同飞溅屏幕主题

发布于 2025-02-01 13:43:44 字数 730 浏览 3 评论 0原文

我有不同的飞溅屏幕徽标设计,用于景观和肖像模式。我为可绘制的土地,可绘制的端口​​,res/values-port和res/values-land创建了文件夹。我给出了两个文件和使用的SplashScreen主题相同的名称,但仅在两种模式上使用肖像画的绘图。如何为景观模式和肖像模式创建不同的飞溅主题。

这就是我目前的

<style name="SplashTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
        <item name="android:windowBackground">@drawable/splash_screen</item>
        <item name="android:statusBarColor">@color/app_bg</item>
    </style>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:drawable="@color/app_bg"/>
    <item android:drawable="@drawable/ic_logo" android:gravity="center"/>
</layer-list>

I have different splash screen logo design for landscape and portrait mode. I created folders for drawable-land, drawable-port, res/values-port and res/values-land. I gave same name both files and used splashScreen theme but just the drawable for portrait works on both modes. How can I create different splashScreen theme for LandScape mode and portrait mode.

This is what I have currently

<style name="SplashTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
        <item name="android:windowBackground">@drawable/splash_screen</item>
        <item name="android:statusBarColor">@color/app_bg</item>
    </style>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:drawable="@color/app_bg"/>
    <item android:drawable="@drawable/ic_logo" android:gravity="center"/>
</layer-list>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

失去的东西太少 2025-02-08 13:43:44

似乎我尝试过的一切工作。我只是在错误的设备上测试。为了为景观和肖像创建一个不同的飞溅屏幕主题,我创建了一个可绘制的土地和可绘制的端口​​文件夹,并添加了各自的可抽签物,从而给了他们相同的名字。然后,我创建了一个Res/Dualder-Land文件夹,并为景观添加了主题。

Seems everything I tried worked. I was just testing on the wrong device. To create a different splashScreen theme for landscape and portrait, I created a drawable-land and drawable-port folder and added their respective drawables, giving them the same name. Then I created a res/values-land folder and added a theme for landscape.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文