该类型的画廊去precated [英] The type Gallery is deprecated

查看:215
本文介绍了该类型的画廊去precated的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

推荐答案

借助图库文件说:

这部件不再支持。其他水平滚动部件包括Horizo​​ntalScrollView和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.

您可以看到该样本的Andr​​oid图库。也有在 GitHub的其他画廊的实现。

You can see this sample Android Gallery. There are also other gallery implementations on GitHub.

这篇关于该类型的画廊去precated的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆