2013-03-14 1 views
0

Я проектирую xml-макет для моего приложения для Android и использую верхний и верхний края макета для размещения вещей на специальном месте. Все в порядке на Android 2.3 и выше, и все элементы включены. собственное место, но на Adroid элемент 2.2 (Fedora) не на своем месте (в несколько раз выше, а иногда и ниже) , Что проблема это мой XML макет Абсолютный латунный край имеет различный эффект для android 2.2

<RelativeLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/carbg" 
    android:layout_width="2000dp" 
    android:layout_height="wrap_content" 
    android:layout_marginLeft="-400dp" android:layout_alignParentBottom="true" android:layout_alignParentRight="true"> 


<ImageView 
    android:contentDescription="@string/app_name" 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/SplashImageView" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_marginTop="240dp" 
    android:src="@drawable/cars" 
    android:layout_marginLeft="180dp" 
    android:adjustViewBounds="false" android:scaleType="center"/> 

<ImageView 
    android:contentDescription="@string/app_name" 
    android:id="@+id/imageView5" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_marginLeft="397dp" 
    android:layout_marginTop="290dp" 
    android:src="@drawable/driver1" android:visibility="visible" android:scaleType="center"/> 

<ImageView 
    android:contentDescription="@string/app_name" 
    android:id="@+id/imageView4" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:src="@drawable/driver2" android:layout_marginLeft="355dp" android:layout_marginTop="290dp" android:visibility="invisible" android:scaleType="center"/> 


<ImageView 
    android:contentDescription="@string/app_name" 
    android:id="@+id/splashsigns" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:src="@drawable/splashsign" 
    android:visibility="invisible" 
    android:layout_marginLeft="320dp" 
    android:layout_marginTop="245dp" android:scaleType="center"/> 


<ImageView 
    android:contentDescription="@string/app_name" 
    android:id="@+id/imageView3" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_marginLeft="630dp" 
    android:layout_marginTop="264dp" 
    android:src="@drawable/danger" 
    android:visibility="invisible" android:layout_marginRight="5dp" android:scaleType="center"/> 



<ImageView 
    android:contentDescription="@string/app_name" 
    android:id="@+id/imageView2" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:src="@drawable/wheel" android:layout_marginTop="363dp" android:layout_marginLeft="535dp" android:scaleType="center"/> 

<ImageView 
    android:contentDescription="@string/app_name" 
    android:id="@+id/imageView1" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:src="@drawable/wheel" android:layout_marginTop="361dp" android:layout_marginLeft="206dp" android:scaleType="center"/> 

моя проблема со всеми изображения Я знаю, что проблема заключается в использовании абсолютного запаса макет, но как решить эту проблему, я хочу иметь одну страницу для всех андроид Vesion это 2pic дескриптов мою проблему лучше enter image description here

проблема Android Icône

enter image description here

ответ

0

Попробуйте эти:

<ImageView 
android:contentDescription="@string/app_name" 
xmlns:android="http://schemas.android.com/apk/res/android" 
android:id="@+id/SplashImageView" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content" 
android:layout_marginTop="240dp" 
android:src="@drawable/cars" 
android:layout_marginLeft="180dp" 
android:adjustViewBounds="false" android:scaleType="fitCenter"/> 
+0

резервуары для вашего внимания, но не работают правильно –

0

Вам нужно попробовать другую опцию android:scaleType, это поможет вам решить эту проблему ih ave решена с использованием android:scaleType="matrix", вы пробовали разные

Смежные вопросы