relative

Android Layout Background Color

In android, we can set the layout background color using background property in layout.
Example for Layout Background Color :-
[sourcecode language="xml"]
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:id="@+id/LinearLayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="#0000ff" />
[/sourcecode]
The output will looks like

Android RelativeLayout

RelativeLayout:

What are the uses of Relative layout?

  • By adding views to relative layout, we can set the relative positions of views with respect to each other.
  • For example if we add three views like imageview, textview and edittext we can specify the position of textview, that is whether it should be below (or any other direction) to edittext or imageview.
  • android:layout_above=”@+id/idname” (Here ”@+id/idname” is the id name of th
Syndicate content