Multiple choice

Which of the following codes is added to XML file for vertical linear layout?

  1. <Linearlayout android:layout_height=”wrap content” android:layout_width=”match parent” android:layout_orientation=”horizontal”>

  2. <Linearlayout android:layout_height=”wrap content” android:layout_width=”match parent” android:orientation=”vertical”>

  3. <Linearlayout android:layout_height=”wrap content” android:layout_width=”match parent” android:orientation=0>

  4. <Linearlayout android:layout_height=”wrap content” android:layout_width=”match parent” android:orientations=”horizontal”>

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

<Linearlayout android:layout_height=”wrap content”

   android:layout_width=”match parent”

   android:orientation=”vertical”> The above code is correct code to set vertical Linearlayout.