Check out example codes for "imageview.setbackground". It will help you in understanding the concepts better.

Code Example 1

imageViewCategory.setBackground(getResources().getDrawable(R.drawable.layout_selected));

Learn ReactJs, React Native from akashmittal.com