现在我使用此代码显示了默认的矩形形状。
this.infoWindow = (ViewGroup)getLayoutInflater().inflate(R.layout.newcustomdialog, null);
this.infoImage=(ImageView)infoWindow.findViewById(R.id.graphicimage);
this.infoTitle = (TextView)infoWindow.findViewById(R.id.balloon_item_title);
this.infoSnippet = (TextView)infoWindow.findViewById(R.id.balloon_item_snippet);
this.close=(Button)infoWindow.findViewById(R.id.close_img_button);
this.infoButton = (Button)infoWindow.findViewById(R.id.more);
//
// Setting custom OnTouchListener which deals with the pressed state
// so it shows up
this.infoButtonListener = new OnInfoWindowElemTouchListener(HomeScreen.this,infoButton)
{
@Override
protected void onClickConfirmed(View v, Marker marker) {
// v.setVisibility(View.GONE);
// Here we can perform some action triggered after clicking the button
Toast.makeText(HomeScreen.this, marker.getTitle() + "'s button clicked!", Toast.LENGTH_SHORT).show();
}
};
//oraii
this.exitButtonListener=new OnInfoWindowExitListener(HomeScreen.this,infoWindow) {
@Override
protected void onClickConfirmed(View v, Marker marker) {
// TODO Auto-generated method stub
}
};
this.infoButton.setOnTouchListener(infoButtonListener);
this.close.setOnTouchListener(exitButtonListener);
map.setInfoWindowAdapter(new InfoWindowAdapter() {
public View getInfoWindow(Marker marker) {
return null;
}
public View getInfoContents(Marker marker) {
// Setting up the infoWindow with current's marker info
StringTokenizer st2 = new StringTokenizer(marker.getTitle(), ",");
String imageurl="";
String title="";
String eventid="";
while (st2.hasMoreElements()) {
eventid=st2.nextElement().toString();
imageurl=st2.nextElement().toString();
title=st2.nextElement().toString();
}
EventId=eventid;
infoTitle.setText(title);
infoSnippet.setText(marker.getSnippet());
imageLoader.DisplayImage(imageurl,HomeScreen.this, infoImage);
infoButtonListener.setMarker(marker);
exitButtonListener.setMarker(marker);
// We must call this to set the current marker and infoWindow references
// to the MapWrapperLayout
mapWrapperLayout.setMarkerWithInfoWindow(marker, infoWindow);
return infoWindow;
}
});
我想将形状更改为心形意味着自定义形状,如图表对话框形状..如何做到这一点..如果有人知道,请帮助我。