欢迎来到Doc100.Net免费学习资源知识分享平台!
您的位置:首页 > 程序异常 >

blackberry启动-图片滚动

更新时间: 2014-01-05 02:42:31 责任编辑: Author_N1

 

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);
	}

}
上一篇:上一篇
下一篇:下一篇

 

随机推荐程序问答结果

 

 

如对文章有任何疑问请提交到问题反馈,或者您对内容不满意,请您反馈给我们DOC100.NET论坛发贴求解。
DOC100.NET资源网,机器学习分类整理更新日期::2014-01-05 02:42:31
如需转载,请注明文章出处和来源网址:http://www.doc100.net/bugs/t/13401/
本文WWW.DOC100.NET DOC100.NET版权所有。