显示xhdpi的mdpi图像

时间:2013-10-21 17:23:58

标签: android android-layout android-linearlayout android-image android-orientation

我正在使用的应用程序具有手机肖像以及平板电脑的纵向和横向。然而,我最近在风景中添加了一个关于启动画面的视图,平板电脑中的横向和纵向模式都在拉动mdpi图像而不是xhdpi,不知道为什么会发生这种情况,任何线索? 这是我的xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/login_bg"
    android:orientation="vertical"
    android:gravity="center" >

    <ImageView
        android:id="@+id/image"
        android:layout_width="750dp"
        android:layout_height="wrap_content"
        android:layout_marginBottom="50dp"
        android:layout_weight="0.36"
        android:paddingLeft="100dp"
        android:paddingRight="100dp"
        android:src="@drawable/splash_logo" />

</LinearLayout>

1 个答案:

答案 0 :(得分:-1)

一种愚蠢的修复,但你肯定你的平板电脑是xhdpi吗?我只是这样说,因为我用来测试的平板电脑实际上是ldpi,当时我认为它是xh​​dpi。

您可以尝试的另一件事是创建一个新的可绘制文件夹drawable-xlarge,它基于屏幕大小而不是像素密度。