2010-09-13 4 views

Répondre

0

tv.setCompoundDrawablesWithIntrinsicBounds (à gauche, en haut, à droite, en bas)?;

+0

@ Merci, Comment puis-je ajouter une image de cette méthode? S'il vous plaît donner un exemple de code .. – sivaraj

+0

gauche/haut/droite/bas = image dessinables. Sinon vous pouvez fournir le ResId (il y a une fonction surchargée qui accepte int) –

1

vous pouvez utiliser

SpannableString ss = new SpannableString("abc"); 
    Drawable d = img.getDrawable(); 
    d.setBounds(0, 0, d.getIntrinsicWidth(), d.getIntrinsicHeight()); 
    ImageSpan span = new ImageSpan(d, ImageSpan.ALIGN_BASELINE); 
    ss.setSpan(span, 0, 3, Spannable.SPAN_INCLUSIVE_EXCLUSIVE); 
    et.setText(ss); 
Questions connexes