Blackberry 透明的 PopupScreen

先看图片吧

Blackberry 透明的 PopupScreen

然后看主类代码
import net.rim.device.api.ui.Color;
import net.rim.device.api.ui.Graphics;
import net.rim.device.api.ui.Manager;
import net.rim.device.api.ui.container.FlowFieldManager;
import net.rim.device.api.ui.container.PopupScreen;

public class PopupView extends PopupScreen {

	public PopupView() {
		super(new FlowFieldManager(Manager.FIELD_HCENTER));
	}

	protected void paint(Graphics g) {
		g.setColor(Color.RED);
		g.drawText("Just do it", 0, 0);
	}

	public void _drawAlpha(int _x, int _y, int _width, int _height, int _color,
			Graphics g) {
		int _array[] = new int[_width * _height];
		for (int i = 0; i < _array.length; i++) {
			_array[i] = _color;
		}
		g.drawARGB(_array, 0, _width, _x, _y, _width, _height);

	}

	protected void paintBackground(Graphics graphics) {
		// super.paintBackground(graphics);
		_drawAlpha(0, 0, this.getWidth(), this.getHeight(), 0X66223311,
				graphics);
	}

	protected void sublayout(int width, int height) {
		// super.sublayout(width, height);
		this.setPosition(0, 12);
		this.setExtent(130, 30);
	}
}


你可能感兴趣的:(UI,.net,BlackBerry)