Android手机中的图像是拉伸的。 WVGA800

时间:2012-10-04 10:09:08

标签: android-layout

我必须开发一个Android应用程序。哪个应用程序已经作为iphone应用程序开发了。 我有用于iphone应用的所有图像。

在我的应用程序中,在第一个屏幕中我必须设置2个图像。它们是640 x 684和640 x236

我的模拟器大小是wvga800。 (440 * 800) 但是当我通过模拟器运行应用程序时。第一张图像显示为strech,并且已被第二张图像重叠。

我使用了相对层。 这是xml代码。

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:scaleType="fitCenter"
        android:contentDescription="@string/main_image"/>


    <FrameLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
        <ImageView
            android:id="@+id/imageView3"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/presshereclick" 
            android:visibility="invisible"
            android:contentDescription="@string/main_image"/>

        <ImageView
            android:id="@+id/imageView2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom"
            android:adjustViewBounds="true"
            android:contentDescription="@string/main_image"
            android:src="@drawable/presshere" />

    </FrameLayout>

</RelativeLayout>

我计划在适合屏幕尺寸(440 * 800)时重新调整图像,但我觉得这可以从编码方面处理。这是我与android的第3天。

请帮我解决这个问题。

提前感谢..

1 个答案:

答案 0 :(得分:0)

使用RelativeLayout时,方向标记没有意义。您需要使用相对标签。对于您的观点,您希望FrameLayout低于ImageView中使用android:layout_below="@id/imageView1" FrameLayout的{​​{1}}。

相关问题