NameTopSecret
NameTopSecret

Reputation: 332

Alternative to android scrollview?

I need a scrollable view on android, but it cannot be a scrollview, because the views I am adding to it is bugging when I use inside scrollview. If I dynamically add those views to a simple linear layout, I cannot see all the views because they are longer than the screen height.

The views I am adding dynamically are android widgets. The app I am developing is quite a simple launcher, so it needs to be able to handle app widgets. But I dont want to use view pager. I need it scrollable like a scrollview.

Note: I tried listview but it is the same issue: some widgets are bugging.

Inside a linearlayout

Inside scrollview

Thanks in advance.

Upvotes: 0

Views: 3685

Answers (2)

NameTopSecret
NameTopSecret

Reputation: 332

So here is the solution

I tried using listview, recyclerview and scrollview. None of them influenced on the bug.

The problem is that I was using wrap_content on the widget's parent, and some of them just had that behavior. So widget's height have to be a value independent to the widget's content, so it cannot be wrap_content.

Thank you guys that tried to help.

Upvotes: 1

keremoflu4
keremoflu4

Reputation: 111

Did you tried to hold your content xml in one layout as child of scrollview?

<ScrollView>

   <LinearLayout>

//your all xml here

   </LinearLayout>

</ScrollView>

Upvotes: 0

Related Questions