简体   繁体   English

如何在水平滚动视图中滚动

[英]How to scroll in horizontal scroll view

I have made a scroll view in my app it works fine. 我已经在我的应用程序中进行了滚动查看,效果很好。 I have some buttons on click of button i want to scroll to desired position. 我要滚动到所需位置时单击一些按钮。 How can i achieve this And one last thing how can i end the spaces between i images in grid view so all the photos sick together. 我该如何做到这一点,最后一件事是如何在网格视图中结束图像之间的间隔,以便所有照片一起出现。 Thanks In Advance. 提前致谢。

Try this: 尝试这个:

yourScrollView.post(
    new Runnable() {
        @Override
        public void run() {
            yourScrollView.scrollTo(desiredPositionX, desiredPositionY);
        } 
    }
);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM