How to have multiple layouts (eg. Relative layouts) stacked one above other (each contains text and images regarding news) and move up/down or animate the top most layout by scrolling action in android studio. Please see this screenshot to kmow what i am talking about https://drive.google.com/file/d/1MrqgKn7CEVuZwkMi8a6ZZB0MXxR3w10R/view?usp=drivesdk
            Asked
            
        
        
            Active
            
        
            Viewed 79 times
        
    0
            
            
        - 
                    https://stackoverflow.com/questions/6674341/how-to-use-scrollview-in-android – algrid Dec 24 '17 at 19:49
 
2 Answers
0
            
            
        
        Sachin Rajput
        
- 4,326
 - 2
 - 18
 - 29
 
- 
                    I have added a screenshot link in the original question for better understanding of what i am trying to achieve. Can you guys please look into that – Kaze Tdr Dec 25 '17 at 02:31
 - 
                    
 
0
            
            
        There's a few ways to accomplish this.
Option 1: Dynamic content - Utilize a Recycler view - In your ViewHolders, use your RelativeLayouts as the layouts to inflate.
Option 2: Static Content - Utilize a ScrollView root - Utilize a vertical LinearLayout with height of wrap_content. - Stack your RelativeLayouts.
Option 3: Another Static Content Option - Utilize a ScrollView - Utilize a RelativeLayout child - Utilize your RelativeLayout childs inside the previous RelativeLayout and use layout_below in each of them.
(Extra info: Consider using ConstraintLayout or something else in place of RelativeLayout to avoid the double measurement issue with RelativeLayout)
        ReverseEffect
        
- 133
 - 6
 
- 
                    I have added a screenshot link in the original question for better understanding of what i am trying to achieve. Can you please look into that – Kaze Tdr Dec 25 '17 at 02:32
 - 
                    See Depth Page Transformer at this link. https://developer.android.com/training/animation/screen-slide.html#pagetransformer – ReverseEffect Dec 25 '17 at 02:35
 
