适合更大屏幕尺寸的Android伸缩屏幕
问题描述:
如何在大屏幕上运行时如何放大我的活动?我已经尝试android:scaleType =“fitXY”为我的imageview,但它不起作用。我已经尝试了很多我研究过的代码,但都没有工作。当我在三星galaxy S2上运行它时,它完美地工作。但是当我在银河音符或星系S2上尝试它时,UI完全不同。所有imageview都很小。适合更大屏幕尺寸的Android伸缩屏幕
下面是S2的UI:
下面是说明和S3的用户界面:
这里的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:background="@drawable/background"
android:orientation="vertical" >
<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:contentDescription="@string/imageDesc"
android:src="@drawable/welcome" />
<Button
android:id="@+id/btnFinance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="240dp"
android:background="@drawable/btn_finance" />
<Button
android:id="@+id/btnHowtouse"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="305dp"
android:background="@drawable/btn_howto" />
<Button
android:id="@+id/btnSettings"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="370dp"
android:background="@drawable/btn_settings" />
<Button
android:id="@+id/btnAbout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="435dp"
android:background="@drawable/btn_about" />
</RelativeLayout>
我也建议你阅读了更多有关如何真正让Android的布局。看起来你的所有按钮和标题栏都是图片。 Android可以处理不同的屏幕尺寸,但由您来配置您的应用程序可以正确执行此操作。 – EGHDK 2012-08-04 20:21:04