Sunday, February 9, 2014

scrollview how the child can automatically occupy the remaining space in maxheight all the time?




Painted like a slash is textview, used scrollview wrapped up, I want the textview text less, when the red button below to follow scrollview piece of wrapcontent size automatically follow below, while a large amount of text textview time, automatically extended to occupy the screen height until all remaining available space, like a set of weight = 1, and the effect in the following figure, the red button is always displayed on the screen, followed scrollview below. If the width is set directly textview wrapcontent, text length when the red button directly below the screen was textview launched outside, do not know how to humbly ask for advice! !


Reply:
Not sure I understand there is no problem that has been with the scrollview button below, and if it appears beyond the screen scrollview scrolling, button at the bottom?

Here is what I wrote, the number of test yourself filling textview height.
android: layout_width = "match_parent"
android: layout_height = "wrap_content"
android: orientation = "vertical"
>

android: layout_width = "match_parent"
android: layout_height = "wrap_content"
android: minHeight = "20dip"
android: scrollbars = "vertical"

android: id = "@ + id / sc"
android: layout_weight = "5"
>
android: layout_width = "match_parent"
android: layout_height = "wrap_content"
android: orientation = "vertical"

>
android: layout_width = "fill_parent"
android: layout_height = "wrap_content"
android: text = "@ string / hello" />
android: layout_width = "fill_parent"
android: layout_height = "wrap_content"
android: text = "@ string / hello" />
android: layout_width = "fill_parent"
android: layout_height = "wrap_content"
android: text = "@ string / hello" />






No comments:

Post a Comment