imageView.setLayoutParams(new Gallery.LayoutParams(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT));
什么其他的方法来取代画廊。因此,我可以在活动使用水平滚动
What are the other methods to replace Gallery. So I can use a horizontal scrolling in activity
借助图库文件说:
这部件不再支持。其他水平滚动部件包括HorizontalScrollView和ViewPager从支持库。
This widget is no longer supported. Other horizontally scrolling widgets include HorizontalScrollView and ViewPager from the support library.
你最好的办法是在其片段布局使用 ViewPager
与的ImageView
。
The best way for you is to use ViewPager
with an ImageView
in its fragment layout.
您可以看到该样本的Android图库。也有在 GitHub的其他画廊的实现。
You can see this sample Android Gallery. There are also other gallery implementations on GitHub.