You cannot request the screen size in XML, because it does not start at run time, you can do this using RelativeLayout and use alignments and margins .
in your case, if Screen_height-banner represents the height of the screen, and you want to place it at the bottom and make the separator 5dp from the end, your XML will be
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > <ScrollView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom" android:layout_marginBottom="5dp"> </RelativeLayout >
If you need to scale the scroll view, not the position, then you, xml, would be
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding_bottom="5dp"> <ScrollView android:layout_width="wrap_content" android:layout_height="fill_parent"> </RelativeLayout >
Ahmad Dwaik 'Warlock'
source share