March 2016
Intermediate to advanced
428 pages
9h 2m
English
As mentioned in the Introduction, the RelativeLayout allows Views to be position-relative to each other and the parent. RelativeLayout is particularly useful for reducing the number of nested layouts, which is very important for reducing memory and processing requirements.
Create a new project and call it RelativeLayout. The default layout uses a RelativeLayout, which we will use to align Views both horizontally and vertically.
res/layout/activity_main.xml file and change it as follows:<TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Centered" android:layout_centerVertical="true" android:layout_centerHorizontal="true" ...
Read now
Unlock full access