相対レイアウトに ImageButton を追加しました。xml コードは
<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"
tools:context=".HomePageActivity" >
<ImageButton
android:id="@+id/imageButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="132dp"
android:background="@null"
android:scaleType="fitXY"
android:src="@drawable/book" />
</RelativeLayout>
幅と高さがwrap_contentであるため、画像は鮮明ですが、次のように幅と高さを大きく指定すると:
android:layout_width="80dp"
android:layout_height="80dp"
次に、AVD で実行すると、画像ボタンが明瞭さを失います。解決策はありますか??