Place a block at the center of a ScrollView

别等时光非礼了梦想. 提交于 2019-12-01 19:38:20

What you can do is try adding android:layout_gravity="center" to ScrollView with its layout_width and layout_height as wrap_content. As ScrollView manages itself to the height and width of its child layouts.

In normal case, ScrollView will only occupy the minimum required space, so the question of vertical alignment(in case of vertical scroll) does not arise at all. You may go through the article in http://www.curious-creature.org/2010/08/15/scrollviews-handy-trick/. It may help you.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!