2011-01-13 4 views
2

を持っている画像は、私はしたくないどのフレームで囲みされ、何が問題なのですか。このようのImageButtonが、私はこのレイアウトを持つフレーム

alt text

本当にありがとうございました!

私は、このランタイムコードとXMLを変更しようとしましたが、私は同じ問題を抱えている:

b = new ImageButton(this); 
      b.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,LinearLayout.LayoutParams.WRAP_CONTENT)); 
      b.startAnimation(alpha_animation); 
      b.setImageBitmap(myBitmap); 

私はボタンで変更のImageButtonのための提案に従うことも試みたが、私は、実行時に画像ソースを設定することができますか?置き換え

+0

私は問題を見つける:b.setPadding(0,0,0,0);すべて正しいです。 – pedr0

答えて

0

ご希望の背景を持つButtonImageButton:あなたはとのImageButtonに画像を追加することができます

<Button 
    android:id="@+id/card_image" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:background="@drawable/icona"/> 
+0

ボタンの画像ソースを実行時にどのように設定できますか?私はちょうどビットマップを持っています。ありがとう – pedr0

+0

あなたは、ボタンのsetBackgroundDrawable()を呼び出して、それにビットマップで渡すBitmapDrawableを渡すことができます – maid450

+0

ありがとう! – pedr0

1

android:src="@drawable/icona"

、その後、nullに背景を設定するなどのこれは:

android:background="@null" 
関連する問題