简体   繁体   English

我应该在Android中为Splash Screen保留什么图像尺寸?

[英]What Image size I should keep in Android for Splash Screen?

I have developed application in Android and designed one splash screen image of size 320x480. 我在Android中开发了应用程序并设计了一个大小为320x480的闪屏图像。 I wish to run this app in mobiles only. 我希望只在手机上运行此应用程序。 But when i run my app in emulator the image is stretched and its not looking good. 但是当我在模拟器中运行我的应用程序时,图像被拉伸并且看起来不太好。 I have gone through the document of developer but it didn't help me enough. 我已经阅读了开发人员的文档,但它对我没有帮助。 So basically i wish to know that what size should i define that the splash screen looks as it is designed and the image should not stretched. 所以基本上我想知道我应该定义什么尺寸的闪屏看起来像它的设计和图像不应拉伸。

My XML file... 我的XML文件......

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
   android:layout_width="fill_parent"
   android:layout_height="fill_parent"
   android:layout_gravity="center"
   android:background="@drawable/screenbackground"
   android:gravity="bottom"
   android:orientation="vertical" >

   <ProgressBar
       android:id="@+id/progressBar1"
       style="?android:attr/progressBarStyleLarge"
       android:layout_width="20dp"
       android:layout_height="20dp"
       android:layout_centerHorizontal="true"
       android:layout_marginTop="10dp" >
   </ProgressBar>

   <TextView
       android:id="@+id/textView1"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:layout_below="@+id/progressBar1"
       android:layout_centerHorizontal="true"
       android:layout_marginTop="8dp"
       android:text="@string/loaddata"
       android:textAppearance="?android:attr/textAppearanceMedium"
       android:textColor="#ffffff" >
   </TextView>
</RelativeLayout>

Please kindly give me suggestion or any link or resources. 请给我建议或任何链接或资源。

Thanks 谢谢

Android Android的

Format 格式

9-Patch PNG (recommended)

Dimensions 外形尺寸

LDPI:
Portrait: 200x320px
Landscape: 320x200px
MDPI:
Portrait: 320x480px
Landscape: 480x320px
HDPI:
Portrait: 480x800px
Landscape: 800x480px
XHDPI:
Portrait: 720px1280px
Landscape: 1280x720px

I know this is an old post, but felt it still needs a bit of touch up to the answers if others do stumble on to this post. 我知道这是一篇很老的帖子,但是如果其他人偶然发现这篇帖子,我觉得它仍然需要对答案进行一些修改。 The following post has the exact details one would require for deciding upon resolution of images in their Splash Screen for different screen sizes : 以下文章详细介绍了在不同屏幕尺寸的Splash Screen中决定图像分辨率所需的详细信息:

android splash screen sizes for ldpi,mdpi, hdpi, xhdpi displays ? Android屏幕大小为ldpi,mdpi,hdpi,xhdpi显示? - eg : 1024X768 pixels for ldpi - 例如:ldpi为1024X768像素

For lazier developers like myself :P, I will provide the values below for minimum screen sizes (all in pixels), which are provided by Google ( the statistics on the relative sizes of devices on Google's dashboard ). 对于像我这样的懒惰开发者:P,我将提供以下最小屏幕尺寸(以像素为单位)的值,这些值由Google提供( 有关Google仪表板上设备相对尺寸的统计数据 )。


Android Mobile Devices : Android移动设备:

LDPI- 426x320 LDPI-426x320

MDPI- 470x320 MDPI-470x320

HDPI- 640x480 HDPI-640x480

XHDPI- 960x720 XHDPI-960x720


Android Tablet Devices : Android平板电脑设备:

LDPI- 200x320 LDPI-200x320

MDPI- 320x480 MDPI-320x480

HDPI- 480x800 HDPI- 480x800

XHDPI- 720px1280px XHDPI- 720px1280px


And of course, 9 Patch images are always recommended for stretchable images. 当然,对于可伸缩图像,始终建议使用9个Patch图像。

it requires different image sizes for different screens 它需要不同屏幕的不同图像尺寸

for default emulator requires 480*800 size of image 对于默认模拟器,需要480 * 800大小的图像

check this link android-splash-screens 检查此链接android-splash-screens

Try setting the size of the view in your XML layout or do it programmatic in the Java file. 尝试在XML布局中设置视图的大小,或者在Java文件中以编程方式执行。 You should be able to size it the way you want. 您应该能够按照自己的方式调整大小。 You may also want to make sure the image itself does not have a lot of "blank space" surrounding it. 您可能还想确保图像本身周围没有很多“空白”。

You should support splash screen images within difference sizes and save to corresponding resource folder. 您应该支持不同大小的闪屏图像并保存到相应的资源文件夹。 For example, the following is a list of resource directories in an application that provides different layout designs for different screen sizes and different bitmap drawables for medium, high, and extra high density screens. 例如,以下是应用程序中的资源目录列表,该列表为不同的屏幕尺寸提供不同的布局设计,为中,高和超高密度屏幕提供不同的位图可绘制。

res/layout/my_layout.xml             // layout for normal screen size ("default")
res/layout-small/my_layout.xml       // layout for small screen size
res/layout-large/my_layout.xml       // layout for large screen size
res/layout-xlarge/my_layout.xml      // layout for extra large screen size
res/layout-xlarge-land/my_layout.xml // layout for extra large in landscape orientation

res/drawable-mdpi/my_icon.png        // bitmap for medium density
res/drawable-hdpi/my_icon.png        // bitmap for high density
res/drawable-xhdpi/my_icon.png       // bitmap for extra high density

Please read this tutorial for details 有关详细信息,请阅读本教程

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM