I have some image buttons in my android project. but they have some gray margins like this pic(I take this pic from real device):
How can I remove them?? I used this code but it doesn't have any effect.
ib.setAdjustViewBounds(true);
Image buttons just defined in java and I don't have them on xml.
ib = new ImageButton(this);
ib.setImageResource(R.drawable.image);
ib.setAdjustViewBounds(true);
ib.setLayoutParams(ibrllp);
How can I remove this additional gray margin?
Set your image button background is null. eg.
ib.setBackground(null);