I want to place an ImageView in a ViewGroup (preferrably a RelativeLayout) like below. The View group is stretch to take full width and height of the activity. I want to ensure whatever the device width is the ImageView height and width should be half of it..
╔═══════════════════════╗
║ ║
║ View Group ║
║ ║
║ ╔═════════════╗ ║
║ ║ ║ ║
║ ║ ImageView ║ ║
║ ║ ║ ║
║ ║ width = X/2 ║ ║
║ ║ height= X/2 ║ ║
║ ╚═════════════╝ ║
║ ║
║ ║
║ ║
╚═══════════════════════╝
<----------------------->
Xpx width of Device/Viewgroup
Can someone please Help how can I achieve this ?