景观和肖像的不同飞溅屏幕主题
我有不同的飞溅屏幕徽标设计,用于景观和肖像模式。我为可绘制的土地,可绘制的端口,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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
似乎我尝试过的一切工作。我只是在错误的设备上测试。为了为景观和肖像创建一个不同的飞溅屏幕主题,我创建了一个可绘制的土地和可绘制的端口文件夹,并添加了各自的可抽签物,从而给了他们相同的名字。然后,我创建了一个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.