-2

私のアプリケーションのログインページをデザインする過程で、メインページの画像が画面に応じて変化することに気付きましたが、時には歪んだ見た目や重なった見た目が得られることがあります。似たような話題についてGoogleのさまざまな記事を見てみると、drawable(hdpi、mdpi、xhdpi、xxhdpi)のサブフォルダに異なる次元の画像を配置し、no-hdpiフォルダに画像を1つ配置すると、トリック。誰かが正しい軌道に導いてくれて、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

'1024×720ピクセルのサイズのメイン画像からさまざまなサイズの画像(hdpi、mdpi、xhdpi、xxhdpi)を取得する方法を教えてください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 Studio用Android Drawable Importerプラグインを使用することができます。私は同じものをリソースのインポートに使用します。

関連する問題