【发布时间】:2015-08-15 09:54:25
【问题描述】:
我为我的 android 应用程序创建了一个启动画面并设置了一个背景图像。 问题是背景图像是从屏幕边框填充的。 这是布局的xml代码:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:custom="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="0dp"
android:paddingRight="0dp"
android:paddingTop="0dp"
android:paddingBottom="0dp"
android:background="@mipmap/splashscreen_drawable"
tools:context="quasiaffatto.myapplication.SplashScreen">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/tv_logo"
android:textColor="@color/color_white"
android:text="App title"
android:textSize="50sp"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:textStyle="bold"
android:gravity="center"/>
</RelativeLayout>
为什么边框上有填充?我该如何解决?
【问题讨论】:
-
你为什么使用这个drawable作为mipmap?您是否尝试过将其用作常规可绘制对象?
-
@Tanis.7x 我用 android studio 创建了一个图片资源,它自动将图片资源创建为 mipmap
-
我不确定我是否理解。 Android Studio 不是图像编辑器,我不知道在其中创建图像资产的任何方法。
标签: android xml padding splash-screen