title: android horizontal scroll view
body: <p>i am beginner in android development and i am trying to create a horizontal scroll view that will contain different layouts.</p>
  
  <p>the error that i am facing is : horozontal scroll view can only host one direct child.
  please advise thanks in advance</p>
  
  <pre><code>&lt;HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tool"
          android:id="@+id/horizontalScrollView1"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:fillViewport="true" &gt;
  
           &lt;LinearLayout
              android:layout_width="wrap_content"
              android:layout_height="fill_parent"
              android:orientation="horizontal"
              android:background="#ff0000"&gt;
  
              &lt;LinearLayout
                  android:layout_width="wrap_content"
                  android:layout_height="fill_parent"
                  android:orientation="horizontal"
                  android:background="#ff0000"&gt;
  
              &lt;/LinearLayout&gt;
  
              &lt;LinearLayout
                  android:layout_width="wrap_content"
                  android:layout_height="fill_parent"
                  android:orientation="horizontal"
                  android:background="#00ff00"&gt;
  
              &lt;/LinearLayout&gt;
  
          &lt;/LinearLayout&gt;
  
      &lt;/HorizontalScrollView&gt;
  </code></pre>