1.

Suppose you are designing activity and you need to set some background image on that screen. How you will make sure this image will look the same in all the screen size of the phone. What kind of image you will use to set background.

Answer»
  • Activity when we need set background image in any view, we need to make sure it will SCALE correctly for different size SCREENS on a variety of devices. For that Android is providing Nine Patch FILES for scaling of backgrounds as View SIZES change. Please find below step for creating MIME patch image.
  • For creating Nine Patch file we need to copy the image in Drawable folder of Android Studio Project. Then right-click and choose menu item "Create 9-Patch file". A nine.png new image will be generated with the same image name. Same small size memory can be reused for different screen size devices. Well-designed Nine-patch images are less error-prone and have high re-usability. 


Discussion

No Comment Found

Related InterviewSolutions