2

I want to display text ,images in single View . kindly help me also i want to give src of image from my class instead of xml kindly help thank you

Abubakar
  • 21
  • 1

3 Answers3

1

You can use Button for this

Button b=new Button(this);
b.setText(" Button");     
b.setCompoundDrawablesWithIntrinsicBounds(null, getResources().getDrawable(R.drawable.btn_call), null, null);
0

Look at TextView here is link

look for android:drawableLeft,android:drawableRight,android:drawbleTop,android:drawbleBottom

to set drawable from class...look for setCompoundDrawablesWithIntrinsicBounds here is link

Hope this help.

Gopal
  • 1,719
  • 12
  • 13
0

You should try to use a normal button with drawableLeft / drawableRight / drawableTop / drawableBotton attribute.

See a sample here: How to create button with image & text

Community
  • 1
  • 1
anticafe
  • 6,816
  • 9
  • 43
  • 74