像 Google Catalogs 一样的水平 ListView
如何制作像 Google Catalogs 中那样的水平列表视图?
较大的主要区域是一个视图页面,但底行是一个水平滚动视图,其中包含可单击的项目列表。我假设它是一个列表视图,如果是的话该怎么做?
我使用了此处其他问题中引用的开源“水平列表视图”,但它的行为并不像此谷歌应用程序中的那样顺利。
how do I make a horizontal list view like the one seen in Google Catalogs?
The large main area is a viewpager, but the bottom row is a horizontal scrollview with a list of items that are clickable. I'm assuming its a listview, if it was how would this be done?
I've used the open source "horizontal list view" that is referenced in other questions here, but it does not act as smoothly like the one in this google app.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这绝对是一个图库!
你可以在这里看到,这肯定是一个 SDK 自带的图库 -> 观看 Youtube 视频来检查它运行的流畅程度;)
我'我从 Android.com 为自己制作了一份简短指南,以供将来参考。我希望您也能使用它:
1) 打开 res/layout/main.xml 文件并插入以下内容:
2) 要在
onCreate()< 上插入的代码/code> 方法:
3) 在res/values/目录下创建一个新的XML文件,命名为attrs.xml。插入以下内容:
4) 返回到 .java 文件,并在
onCreate(Bundle)
方法之后,定义自定义ImageAdapter
类:< /strong>嗯...代码很简单,但是你可以参考原始且较长的文档 这里。
It's definitely a Gallery!
You can see here that for sure it's a Gallery that comes with the SDK -> See Youtube video to check how smooth it runs ;)
I've made to myself a short guide from Android.com for future reference. I hope that you can use it too:
1) Open the res/layout/main.xml file and insert the following:
2) Code to insert on your
onCreate()
method:3) Create a new XML file in the res/values/ directory named attrs.xml. Insert the following:
4) Go back to your .java file and after the
onCreate(Bundle)
method, define the customImageAdapter
class:Well... the code is very simple, but you can refer to the original and longer document here.
我不确定,但我认为它是一个画廊( http://developer. android.com/reference/android/widget/Gallery.html )将回调发送到 ViewPager。
您可以在此处找到示例代码: http://www.androidpeople.com/android-gallery-example
您需要回调 viewpager 并设置所需的页面,而不是 toast。
我想它会满足你的要求! :-)
I'm not sure, but i think it's a Gallery ( http://developer.android.com/reference/android/widget/Gallery.html ) that sends callbacks to the ViewPager.
You can find a sample code here: http://www.androidpeople.com/android-gallery-example
Instead of the toast you need to callback the viewpager and set the page you want.
I think it will do want you want! :-)