Gallery:
A view that shows items in a center-locked, horizontally scrolling list.
The default values for the Gallery assume you will be using Theme_galleryItemBackground as the background for each View given to the Gallery from the Adapter. If you are not doing this, you may need to adjust some Gallery properties, such as the spacing.
Views given to the Gallery should use Gallery.LayoutParams as their layout parameters type.
即,画廊,可以左右滑动,选中的项默认为居中。
重要属性:
android:animationDuration Sets how long a transition animation should run (in milliseconds) when layout has changed.
android:spacing 设置每个子项之间的距离
android:unselectedAlpha Sets the alpha on the items that are not selected.
示例1:
示例2:
本文详细介绍了Android中的Gallery控件,包括其默认行为、关键属性及使用示例。通过两个实例展示了如何自定义适配器来展示图片,并实现点击监听及上下文菜单功能。
2452

被折叠的 条评论
为什么被折叠?



