0

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

Kaze Tdr
  • 11
  • 1
  • 2

2 Answers2

0

 the nter image description here in the new version of Android studio you can resize your preview layout by drag it. try this

Sachin Rajput
  • 4,326
  • 2
  • 18
  • 29
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)

  • 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