小编Yur*_*Kot的帖子

在图层列表中创建drawable do centerCrop

所有.

我想制作闪屏:

<style name="SplashTheme" parent="Theme.AppCompat.NoActionBar">
    <item name="android:windowBackground">@drawable/background_splash</item>
</style>
Run Code Online (Sandbox Code Playgroud)

绘制/ background_splash:

<?xml version="1.0" encoding="utf-8"?>
Run Code Online (Sandbox Code Playgroud)

<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>
Run Code Online (Sandbox Code Playgroud)

但我没有能力用android创建位图:src ="@ drawable/splash_logo"在ImageView中调整为centerCrop比例(我需要我的位图填充所有宽度)现在它的大小就像资源中的大小一样.如果我做得更大,屏幕会更大.我尝试过刻度可绘,没有任何意义.

你有什么建议吗?

android splash-screen image-resizing

6
推荐指数
1
解决办法
2015
查看次数

标签 统计

android ×1

image-resizing ×1

splash-screen ×1