开发者

Controlling the scroll bar in my Android application

开发者 https://www.devze.com 2023-02-18 13:20 出处:网络
I have three linear sub layouts in my activity window in my Android application. Each layout has one scroll bar. My pro开发者_C百科blem is when I am trying scroll in one layout area other layouts scro

I have three linear sub layouts in my activity window in my Android application. Each layout has one scroll bar. My pro开发者_C百科blem is when I am trying scroll in one layout area other layouts scroll bars also activating. Could you please suggest a solution for this?


ONE <scrollView> can hold at max ONE component inside it....... this ONE component can be either a layout holding several other views or further layouts inside it, or it can be a single view.

in order to have 3 separate scrolling linear layouts (meaning scrolling one linearLayout does not affect other LinearLayouts)..... you should have 3 separate <ScrollView> elements - each scrollview containing at max ONE of your THREE linearLayout.

for example:

<ScrollView>
   <LinearLayout>
      all sub-components of **LinearLayout1** goes here
   <LinearLayout>
</ScrollView>

<ScrollView>
   <LinearLayout>
      all sub-components of **LinearLayout2** goes here
   <LinearLayout>
</ScrollView>

<ScrollView>
   <LinearLayout>
      all sub-components of **LinearLayout3** goes here
   <LinearLayout>
</ScrollView>

hope it helps you.

0

精彩评论

暂无评论...
验证码 换一张
取 消