I have the following XML layout
<RelativeLayout>
<ScrollView>
</ScrollView>
<LinearLayout>
</LinearLayout>
</RelativeLayout>
Into the LinearLayout I am adding an admob AdView through code. The ScrollView contains content and displaying it before the AdView getting intialized.
The problem is, when the Ad gets shown the ScrollView scrolls down in the size (height) of the Ad.. I am guessing that because the ScrollView is set to height=match_parent and above=LinearLayout, when the ad initialized the ScrollView gets resized and that is what causing the scroll (LinearLayout is set to align to parent bottom).
Is there any way to get around it? I want the ScrollView to stay in the same scroll offset that it was on before the ad got to shown on the screen.
Add android:descendantFocusability="blocksDescendants"
to the immediate child of Scrollview
. It'll solve the problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With