I want to implement something like ViewPager or ScrollView, but I don't want to use it for some reasons. As I understand, I need to resize the parent layout to the width of N*(width of screen), N is number of pages. How can I do this?
我想实现像ViewPager或ScrollView这样的东西,但出于某些原因我不想使用它。据我所知,我需要将父布局的大小调整为N *(屏幕宽度)的宽度,N是页数。我怎样才能做到这一点?
1
try to use an horizontal scrollView and set your layout width by pixel like this
尝试使用水平scrollView并按像素设置您的布局宽度
android:layout_
or
要么
android:layout_
And then add your layout to the scrollView.
然后将您的布局添加到scrollView。