【发布时间】:2016-08-22 14:23:21
【问题描述】:
全部。
我想制作闪屏:
<style name="SplashTheme" parent="Theme.AppCompat.NoActionBar">
<item name="android:windowBackground">@drawable/background_splash</item>
</style>
drawable/background_splash:
<?xml version="1.0" encoding="utf-8"?>
<item
android:drawable="@color/main_theme"/>
<item android:bottom="16dp">
<bitmap
android:gravity="center|fill_horizontal"
android:src="@drawable/splash_logo"
/>
</item>
<item android:bottom="16dp">
<bitmap
android:gravity="bottom"
android:src="@drawable/logo"/>
</item>
但我无法使用 android:src="@drawable/splash_logo" 将位图调整为 ImageView 中的 centerCrop 比例(我需要我的位图填充所有宽度)现在它的大小以像素为单位的资源大小。如果我把它做得更大,屏幕就会更大。我尝试了 scale drawable,但没有任何意义。
你有什么建议吗?
【问题讨论】:
-
你得到这个答案了吗?
-
不,对于那些问题,这是不可能的。也许从那时起有些事情发生了变化。您所能做的就是使一些可绘制的成为例如100dp。
-
好的,我明白了,感谢您的回复。
标签: android splash-screen image-resizing