Android widget—Gallery学习笔记

来源:互联网 发布:plc编程入门到精通 编辑:程序博客网 时间:2024/06/05 00:13

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: