How to do a ScrollView in a LinearLayout correctly

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

How to do a ScrollView in a LinearLayout correctly

Postby MrSnowflake » Wed Nov 26, 2008 12:04 pm

How should we correctly use a ScrollView in a LinearLayout, where I want a static LinearLayout at the bottom of the main LinearLayout (let's call it layMain, the ScrollView just scroll and the bottom layBottom). An example (it's not a valid layout structure, only for demo):
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <LinearLayout id="main">
  2.  
  3. <ScrollView id="scroll"/>
  4.  
  5. <LinearLayout id="layBottom" orientation="vertical" gravity="bottom">
  6.  
  7.   <Button />
  8.  
  9.   <Button />
  10.  
  11. </LinearLayout>
  12.  
  13. </LinearLayout>
  14.  
  15.  
Parsed in 0.001 seconds, using GeSHi 1.0.8.4

The problem is, when the view inside scroll grows bigger than the screen, either, scroll obscures layBottom, or scroll goes under layBottom, rendering the lower Views in scroll unusable.

Does anyone have an idea? I tried putting it in a FrameLayout, and scroll goes underneath layBottom.
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 4 guests