#を試してみてください。あなただけの背景Image
でButton
をしたい場合は、これを試してみてください:
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/ic_launcher"/>
OR、あなたは以下のようにImageButton
を使用することができます。
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/ic_launcher" />
#。
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="BUTTON"
android:background="@mipmap/ic_launcher"/>
#:あなたはText
と背景Image
でButton
をしたい場合は、これを試してみてください。あなたはText
とButton
をしたいと描画可能Icon
を残した場合は、これを試してください:あなたがイメージを置きたい
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="BUTTON"
android:drawableLeft="@mipmap/ic_launcher"/>
出典
2017-05-05 11:02:09
FAT
? –
私はちょうどテキストの代わりにイメージのボタンが欲しいです。画像はres/mipmapフォルダにあり、画像アセットをインポートした後、android studioがそれを保存します。 – user1111652
アプリアイコン以外の 'mipmap'フォルダは使用しないでください。グラフィカルリソースは 'drawable'を使います。 –