小编sou*_*ito的帖子

将drawable设置为android:windowBackground

我试图制作一个在任何通货膨胀之前显示的启动画面,我通过在我的SplashActivities主题中设置一个drawable到android:windowBackground来做到这一点:

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

提拉正在显示全屏位图(有一个针对横向和土地/端口的文件夹肖像),而不是一个更小的图像或图标,它看起来象下面这样:

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@color/dark_gray"/>

    <item>
        <bitmap android:src="@drawable/splash_screen" android:gravity="center"/>
    </item>
</layer-list>
Run Code Online (Sandbox Code Playgroud)

由于它是全屏图像,我希望它在不拉伸的情况下填充屏幕,与使用adjustViewBounds的ImageView时的行为相同,并且scaleType设置为fitCenter时.

所以要指定我不是在寻找布局或ImageView设置,而是一个可以应用于windowBackground的drawable.我强调这一点是因为我发现的大多数搜索结果都是在应用程序启动后实现的启动画面.

android splash-screen android-xml android-theme android-drawable

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

在Android Studio中导入Urban Airship会产生编译问题吗?

我是Android Studio的新手,我想在我的一个项目中实现Urban Airship.我在他们的网站上使用.aar文件跟踪了示例,我最终得到了这个错误.

Error: [/Users/AndroidstudioProjects/MyApplication/app/build/intermediates/exploded-aar/com.urbanairship/urbanairship-lib/5.1.0/AndroidManifest.xml:8]
Invalid instruction 'overrideLibrary', valid instructions are : REMOVE,REPLACE,STRICT
Run Code Online (Sandbox Code Playgroud)

如果我错了,请纠正我,但这是否意味着他们的清单文件中存在问题?还是我完全是蓝色的?如果是这样,有没有人有一个如何实现它的好例子?

android android-manifest urbanairship.com android-studio aar

4
推荐指数
1
解决办法
2531
查看次数