But both are looking differnt
First, the drawables are different.
Second, the background always scales to the size of the view.
when i press the imageview with background set it is not showing the selection. can anyone explain why this happens
The selection effect is because by default, the background is a StateListDrawable with a different appearance in state_pressed
. Your custom background looks the same in all states. You can create StateListDrawables
in xml with a selector.