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: