Rectangle 27 0

user interface android vertical scroll bar and content not visible?


<com.uberaktiv.ui.layout.MetroLikeLayout android:layout_width="fill_parent" android:layout_height="wrap_content">
    <ScrollView android:layout_width="match_parent" android:id="@+id/scrollView1" android:layout_height="fill_parent" android:layout_weight="1.0">
        <Button android:text="Button 1" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
        <Button android:text="Button 2" android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
        <Button android:text="Button 3" android:id="@+id/button3" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
        <Button android:text="Button 4" android:id="@+id/button4" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
        <Button android:text="Button 5" android:id="@+id/button5" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
    </ScrollView>
</com.uberaktiv.ui.layout.MetroLikeLayout>

MisterSquonk, even though i prefer to understand what's the problem with my layout settings, i now thought of an idea in which i will programaticaly add a scroll view to my custom view and then loop through the children. but even just for academic reasons, I'd like to know what i'm missing in my layout above.

Thanks MisterSquonk. I will try your solution, although I fear, at first glance it may not do. The MetroLikeLayout view goes over its direct children and positions them according to the calculated sizes, which allow the requested functionality. my initial thought is that my view will calculate and try resize and reposition of the scrollview and not the children. however, i will try and may need to change the code. Thanks for the help.

Try putting the ScrollView inside the MetroLikeLayout around just the buttons like this...

Note