1

ScrollViews can only take one child element, and this feels like an oversight to me. Looking at the way I implement layouts I see myself typically making a ScrollView with a LinearLayout child. I can see other people using a different child view such as RelativeLayout, unless they were forced not to. Which brings me to my next point:

Can Scrollview's be implemented that automatically has a vertical LinearLayout in it?

I got the inspiration from the modified NestedScrollView object and some other extended Scrollview classes on github

Now my code and view layouts could feel cleaner!

CQM
  • 42,592
  • 75
  • 224
  • 366
  • If you are asking if you can create a subclass of `ScrollView` that automatically has a `LinearLayout` child, that should be possible. If you are asking if you can retcon `ScrollView`, such that ~1.5 billion Android devices are locked into having `ScrollView` hold a `LinearLayout`, then that will require time travel. – CommonsWare Jul 18 '16 at 21:00
  • As @CommonsWare mentioned this is only possible by extending ScrollView and providing auto-add a LinearLayout child. – Michael Spitsin Jul 18 '16 at 21:03

0 Answers0