在我的 Android 地图应用程序中,我有一些集群图标。每当按下集群图标时,我想显示一个带有文本和按钮的弹出信息框。如果我们按下按钮,它将导致下一个活动。
private void drawInfoWindow(Canvas canvas, MapView mapView, boolean shadow,
int x, int y) {
if (isSelected_) {
Point selDestinationOffset = new Point();
mapView.getProjection().toPixels(cluster_.center_,
selDestinationOffset);
// Setup the info window with the right size & location
int INFO_WINDOW_WIDTH = 125;
int INFO_WINDOW_HEIGHT = 25;
RectF infoWindowRect = new RectF(0, 0, INFO_WINDOW_WIDTH,
INFO_WINDOW_HEIGHT);
infoWindowRect.offset(x, y);
// Draw inner info window
canvas.drawRoundRect(infoWindowRect, 5, 5, getInnerPaint());
// Draw the MapLocation's name
int TEXT_OFFSET_X = 10;
int TEXT_OFFSET_Y = 15;
canvas.drawText(cluster_.number+" Incidents", x + TEXT_OFFSET_X, y
+ TEXT_OFFSET_Y, getTextPaint());
}
}
这仅显示一个小的文本视图,如弹出窗口。但我想显示一个带有文本和按钮的弹出信息框。请给我最好的方法....
谢谢...