title: Fixed position for elements inside scroll views in both directions
body: <p>I am building a view in my Android application which should scroll both horizontal and vertical. Therefore I have surrounded my view with a horizontal scroll view and inside this horizontal scroll view I have another scroll view (vertical scroll view).</p>
  
  <p>In the top of the scroll view I have a timeline (red in the illustration). When scrolling the vertical scroll view, the timeline should be static. It should stay in top. So this timeline is visible in the top at all times.</p>
  
  <p>In the left of these scroll views, I have five buttons (different colors in the illustration). These buttons should scroll with the vertical scroll view but not the horizontal scroll view, meaning these should be visible in the left side at all times.</p>
  
  <p>The white area in the scroll view will scroll both ways.</p>
  
  <p>I have managed to have the timeline (red in the illustration) stay at top and only scroll with the horizontal scroll view but I cannot figure out where I should put my five buttons to make sure, that these will also stay on top and only scroll with the vertical scroll view.</p>
  
  <p>This is my layout as it is now with the timeline staying at top.</p>
  
  <pre><code>&lt;!-- Horizontal scroll view --&gt;
  &lt;HorizontalScrollView android:id="@+id/schedule_concerts_scroll_view" 
                        android:layout_width="wrap_content"
                        android:layout_height="fill_parent" 
                        android:fadingEdge="none" 
                        android:scrollbars="none"
                        android:layout_below="@+id/schedule_day_pager_layout"&gt;
  
      &lt;!-- Scroll container for horizontal scroll view --&gt;
      &lt;RelativeLayout android:layout_width="wrap_content"
                      android:layout_height="fill_parent"
                      android:id="@+id/schedule_layout"&gt;
  
          &lt;!-- The timeline (red in the illustration) Should only scroll horizontal and stay at top --&gt;
          &lt;RelativeLayout android:id="@+id/schedule_timeline"
                          android:layout_width="wrap_content"
                          android:layout_height="23dp"
                          android:layout_marginBottom="0dp"
                          android:layout_alignParentTop="true" /&gt;
  
          &lt;!-- Vertical scroll view --&gt;
          &lt;ScrollView android:layout_height="wrap_content"
                      android:layout_width="wrap_content"
                      android:fadingEdge="none"
                      android:scrollbars="none"
                      android:layout_below="@+id/schedule_timeline"&gt;
  
              &lt;!-- Scroll container for vertical scroll view --&gt;
              &lt;RelativeLayout android:layout_width="wrap_content"
                              android:layout_height="wrap_content"&gt;
  
                  &lt;!-- The content here should be scrolling both ways --&gt;
  
              &lt;/RelativeLayout&gt;
  
          &lt;/ScrollView&gt;
  
      &lt;/RelativeLayout&gt;
  
  &lt;/HorizontalScrollView&gt;
  </code></pre>
  
  <p>This is the illustration, I have been referring to. This should help explain how my layout should end up.</p>
  
  <p><img src="https://i.stack.imgur.com/JTsZW.png" alt="Illustration of scroll directions"></p>
  
  <p>Does anyone know how I can achieve the scroll in both directions with views having a fixed position for both directions?</p>