blackberry起步-图片滚动
1、图片滚动
package com.bb.test; import net.rim.device.api.system.Bitmap; import net.rim.device.api.ui.Color; import net.rim.device.api.ui.container.MainScreen; import net.rim.device.api.ui.decor.BackgroundFactory; import net.rim.device.api.ui.extension.component.PictureScrollField; import net.rim.device.api.ui.extension.component.PictureScrollField.HighlightStyle; import net.rim.device.api.ui.extension.component.PictureScrollField.ScrollEntry; public class PictureScrollFieldDemoScreen extends MainScreen{ public PictureScrollFieldDemoScreen() { setTitle("PictureScrollField Demo"); //图片 Bitmap[] images = new Bitmap[3]; images[0] = Bitmap.getBitmapResource("11.png"); images[1] = Bitmap.getBitmapResource("22.png"); images[2] = Bitmap.getBitmapResource("33.png"); //图片标签 String[] labels = new String[3]; labels[0] = "Label for image 1"; labels[1] = "Label for image 2"; labels[2] = "Label for image 3"; //文本标注 String[] callout = new String[3]; callout[0] = "information 11"; callout[1] = "information 22"; callout[2] = "information 33"; //创建三个滚动条目 ScrollEntry[] entries = new ScrollEntry[3]; for (int i = 0; i < entries.length; i++) { entries[i] = new ScrollEntry(images[i], labels[i], callout[i]); } //entries[0].setCallout("aaaaaaa"); PictureScrollField pictureScrollField = new PictureScrollField(300, 257); pictureScrollField.setData(entries, 0); pictureScrollField.setHighlightStyle(HighlightStyle.ILLUMINATE); pictureScrollField.setHighlightBorderColor(Color.BLUE); pictureScrollField.setBackground(BackgroundFactory.createSolidTransparentBackground(Color.LIGHTBLUE, 100)); pictureScrollField.setLabelsVisible(true); pictureScrollField.setTextColor(Color.YELLOWGREEN); add(pictureScrollField); } }
相关推荐
sxaudq0 2011-10-12
小桥流水丿小溪 2013-05-03
lynxnative 2014-08-28
peixiaopao 2011-11-18
齐北的小村 2011-10-25
海绵宝宝的欧尼 2011-07-06
evilvoid 2010-07-23
人走丿茶凉 2015-08-24
86201242 2012-03-01
南魂0 2011-10-20
征服Linux 2011-04-01
虫二在路上 2016-02-25
zzpp 2010-02-01
Mingwxl 2010-01-31
nklinux 2009-01-07
flyer 2012-03-07
huangkun 2012-12-05