Android why background image extends scrollview -
Hello, I have a scrollview and relative layout.
When I drop the background for ScrollView, ScrollView increases the height of the background image.
When I run the application, I think the activity can scroll down and there is no object in this area.
& lt; ScrollView xmlns: Android = "http://schemas.android.com/apk/res/android" android: id = "@ + id / scrollview01" Android: layout_width = "match_parent" android: layout_height = "match_parent" android: fillViewport = "True" Android: Scrollbar = "None" Android: Background = "@ Drawable / Back 2" Android: padding = "0dp" & gt; & Lt; Android: paddingLeft = "@ Dimen / activity_horizontal_margin" Android: paddingRight = "@ Dimen / activity_horizontal_margin" Android: paddingTop = "Android: paddingBottom =" @ Dimen / activity_vertical_margin "Android: layout_width =" match_parent "Android: layout_heid =" match_parent " @ Dimen / activity_vertical_margin "Android: padding =" 0dp "& gt; I think your problem is relativeLayout height when you scroll it in If you put it, you can not match the relative length height to the parent. ScrollView does not have the exact internal height, so your relative layout can not measure their height. This means that in your case there may be any height in your relational layout, even it is empty. For example it can be 2 screens or unforeseen scales (in the case of the infinite scroll). It is undefined behavior and you can not wait for any exact height in this case. You can only place the layout_height = "match_parent" element inside that layout whose height is set.
Comments
Post a Comment