2016-05-22 1 views
-1

私の同僚はメインメニューの中に入るためにいくつかのpngを作成しました。私はhdpi xhdpiなどを合わせるために、すべてのPNG画像に入ったが、私は「一人のプレイヤーのゲーム」を入れたときに「イメージビューを正しいサイズにスケールする方法は? (私のPNG画像は小さいです)

enter image description here

:PNG画像は、このような適切なサイズに縮小することが想定されています2つのプレーヤーのゲームは、」画像が縮小し、サイズ合わない 『終了このquestion次scaleType『:アンドロイド』ボタン

enter image description here

を私はすべてのバリエーションを試してみました』。また、私は(私は今見つけることができないdiffの質問を通して)パディングを試みた。これらの決断は私を助けませんでした。

pngの内部にあるこれらのテキストをどのようにスケールアップするかを教えていただければ幸いです。ここで

は私のXMLコードです:

<?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:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="@color/colorBackground" 
    android:paddingBottom="@dimen/activity_vertical_margin" 
    android:paddingLeft="@dimen/activity_horizontal_margin" 
    android:paddingRight="@dimen/activity_horizontal_margin" 
    android:paddingTop="@dimen/activity_vertical_margin" 
    android:layoutDirection="ltr" 
    tools:context="com.inbaltako.tictactoe.MenuActivity"> 


    <ImageView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:src="@drawable/logo" 
     android:paddingTop="50dp" 
     android:id="@+id/imageView" 
     android:layout_alignParentTop="true" 
     android:layout_centerHorizontal="true" /> 

    <RelativeLayout 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_centerInParent="true" 
     android:id="@+id/relativeLayout"> 

    </RelativeLayout> 

    <ImageButton 
     android:id="@+id/exitBtn" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:src="@drawable/exit_btn" 
     android:background="@color/colorPrimary" 
     android:padding="16dp" 
     android:onClick="btnClicked" 
     android:layout_marginTop="2dp" 
     android:layout_below="@+id/two_player_game" 
     android:layout_toStartOf="@+id/relativeLayout" /> 

    <ImageButton 
     android:id="@+id/one_player_game" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:src="@drawable/one_player_game" 
     android:background="@color/colorPrimary" 
     android:onClick="btnClicked" 
     android:padding="16dp" 
     android:layout_below="@+id/relativeLayout" 
     android:layout_alignStart="@+id/two_player_game" /> 

    <ImageButton 
     android:id="@+id/two_player_game" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:scaleType="fitXY" 
     android:src="@drawable/two_players_game" 
     android:background="@color/colorPrimary" 
     android:onClick="btnClicked" 
     android:padding="16dp" 
     android:layout_below="@+id/relativeLayout" 
     android:layout_alignStart="@+id/exitBtn" 
     android:layout_marginTop="39dp" /> 


</RelativeLayout> 
+1

https://developer.android.com/guide/practices/screens_support.html –

答えて

1

それはあなたがあなたのドローアブルを置く場合、私の右の場所を知るのは難しいです。 それが単なるテキストの場合、なぜTextViewを使用していないのですか?はるかに簡単にする必要があります。 テキストだけの画像を扱うことは適切ではありません。

+0

こんにちはShalevをご覧ください。私は何度も再チェックしたので、私は正しい場所にドロアブルを置いたと信じていますが、もう一度チェックします。テキストビューについては、私の同僚がデザインに接続しているので、イメージで作業することになります。 (私はその理由は、それがそのデザインで遊ぶ方が簡単だと信じています) どのように高速返信に感謝します。 – Tomer

+0

非常にユニークなボタンを使用していない限り、pngを使用する理由はありません。彼女はあなたにpngをエクスポートし続けることができます。xmlを使用してそれらを実装するだけです(これは私のデザイナーと一緒に作業する方法です)。こうすることで、さまざまな画面を使用したときに見た目がよくなるでしょう。 –

+0

ありがとう、私はおそらくあなたの助言を取り、textview – Tomer

関連する問題