2011-06-21 74 views
0

我正在創建一個需要背景圖像的應用程序。我已閱讀Android開發人員指南,瞭解如何執行此操作,並使用三種不同的DPI創建了該映像; 120160240。中小dpi圖像的工作原理是,240圖像的圖像被拉伸得很奇怪。而這只是在240 * 320的分辨率上,當我在更大的屏幕上嘗試它時,我的圖像又被拉伸了。我的佈局包含重複背景圖案圖像,遙控器圖像和圖像按鈕。 http://dl.dropbox.com/u/16826969/layout.png 我無法將我的按鈕放在每個屏幕(位置)上都不相同。 我也嘗試了drawable-nodpi,並且製作了一個圖像大小的屏幕,認爲它可以在更大的屏幕上顯示效果很好......它不是...... 你能幫我解決這個問題嗎?我可以閱讀的教程?我可以通過的任何示例?在Android上支持多個屏幕;背景圖像問題

<?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="@layout/backrepeat" android:focusable="false"> 
<ImageView android:layout_width="match_parent" android:background="@drawable/remotedpi" 
    android:id="@+id/imageView1" android:layout_height="wrap_content" android:scaleType="fitEnd"/> 
<ImageView android:layout_marginBottom="10dip" 
    android:layout_marginRight="25dip" android:id="@+id/ButtonTestPlay" 
    android:layout_height="wrap_content" android:layout_width="wrap_content" 
    android:src="@drawable/play" android:layout_alignParentRight="true" 
    android:layout_alignParentBottom="true" /> 
<ImageView android:layout_marginBottom="10dip" 
    android:layout_marginLeft="25dip" android:id="@+id/ButtonTestPause" 
    android:layout_height="wrap_content" android:layout_width="wrap_content" 
    android:src="@drawable/stop" android:layout_alignParentLeft="true" 
    android:layout_alignParentBottom="true" /> 
<ImageView android:id="@+id/ButtonStatus" 
    android:layout_height="wrap_content" android:layout_width="wrap_content" 
    android:src="@drawable/stop_hover" android:layout_alignParentLeft="true" 
    android:layout_marginLeft="23dip" android:layout_marginTop="105dip" /> 
</RelativeLayout> 

編輯:我已經通過文章支持多種屏幕尺寸的閱讀我 也試過9patch圖像,但我的遙控器圖像內容,我什麼都不想streched

我需要做每個dpi的每個分辨率的圖像? 例如:320 * 240 160 dpi,480 * 880 160 dpi在可繪製mdpi文件夾中 和hdpi文件夾中的240 dpi圖片。

回答