-2

在爲我的應用程序設計登錄頁面的過程中,我注意到我的主頁上的圖像根據屏幕(它應該)而有所不同,但我有時會看到扭曲的外觀或重疊的外觀。在類似主題的谷歌瀏覽各種文章的建議是將不同維度的圖像放置在可繪製子文件夾(hdpi,mdpi,xhdpi,xxhdpi)中,有人甚至建議將單個圖像放在no-hdpi文件夾中應播放招。請有人請指導我正確的軌道,也讓我知道我怎麼能從主圖像是1024 * 720像素的大小的各種尺寸(hdpi,mdpi,xhdpi,xxhdpi)的圖像。根據設備的Android圖像縮放

下面是我的主要佈局。 我有一個按鈕,圖像視圖和圖像按鈕。我想要的是應該沒有圖像視圖和圖像按鈕之間的差距/分隔。該按鈕通過圖像視圖(工作正常)。

<?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:id="@+id/LinearLayout1" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" > 
    <Button 
     android:id="@+id/about" 
     android:background="@android:color/transparent" 
     android:src="@drawable/download" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:scaleType="centerCrop" 
     android:textSize="15sp" 
     android:adjustViewBounds="true" 
     android:paddingTop="-5dp" 
     android:text="About" 
     android:linksClickable="true" 
     android:layout_alignParentLeft="true" 
     android:textAlignment="center" 
     android:textColor="@color/orangered"/> 

    <ImageView 
     android:id="@+id/C_image_view" 
     android:src="@drawable/kamakshi" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 

     android:scaleType="centerCrop" 
     android:layout_weight="5"/> 
    <ImageButton 
     android:id="@+id/download" 
     android:src="@drawable/download" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_alignBottom="@id/about" 
     android:layout_alignParentBottom="true" 
     android:scaleType="centerCrop" 
     android:layout_weight="5" 
     /> 

</RelativeLayout> 
+0

http://stackoverflow.com/a/42780528/5471104 –

+0

'讓我知道如何從主圖像獲得各種尺寸(hdpi,mdpi,xhdpi,xxhdpi)的圖像,其尺寸爲1024 * 720像素使用Gimp或類似的工具(2D圖形編輯器) –

回答

0
Could somebody please guide me to the right track and also let me know how can i get images of various dimensions (hdpi, mdpi,xhdpi,xxhdpi) from the main image which is 1024*720 px in size. 

可以使用Android Drawable Importer插件Android的工作室。我使用相同的導入資源。