-1
A
回答
1
在這樣
@Override
protected boolean onTap(int index)
{
item = mOverlays.get(index);
displaySearchResultBubble();
return true;
}
和方法的過度類別的呼叫ONTAP馬託
是
private void displaySearchResultBubble() {
//Hide the bubble if it's already showing for another result
mapView.removeView(bubble);
bubble.setVisibility(View.GONE);
///
GeoPoint point11 = item.getPoint();
///
//Set some view content
venueName.setText("Your Message");
MapView.LayoutParams params = new MapView.LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT,
point11, MapView.LayoutParams.BOTTOM_CENTER);
bubble.setLayoutParams(params);
mapView.addView(bubble);
mapView.measure(MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED), MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
Runnable r = new Runnable() {
public void run() {
Animation fadeIn = AnimationUtils.loadAnimation(mContext, R.anim.fadein);
bubble.setVisibility(View.VISIBLE);
bubble.startAnimation(fadeIn);
}
};
//This projection and offset finds us a new GeoPoint slightly below the actual OverlayItem,
//which means the bubble will end up being centered nicely when we tap on an Item.
Projection projection = mapView.getProjection();
Point p = new Point();
projection.toPixels(point11, p);
p.offset(0, -(bubble.getMeasuredHeight()/2));
GeoPoint target = projection.fromPixels(p.x, p.y);
//Move the MapView to our point, and then call the Runnable that fades in the bubble.
mapView.getController().animateTo(target, r);
}
和你泡
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingLeft="62dip"
>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<TextView
android:layout_width="185dip"
android:layout_height="wrap_content"
android:id="@+id/venuename"
android:gravity="center_vertical"
android:singleLine="true"
android:hint="Hello"
android:textSize="26px"
>
</TextView>
</LinearLayout>
</RelativeLayout>
在上添加此創建方法
LayoutInflater inflater = ((Activity) mContext).getLayoutInflater();
bubble = (RelativeLayout) inflater.inflate(R.layout.bubble, mapView, false);
venueName = (TextView) bubble.findViewById(R.id.venuename);
希望你有你的答案是完整的解決方案
1
相關問題
- 1. 字對話框點擊
- 2. jQuery的:在用戶界面對話框禁用點擊功能
- 3. 按鈕點擊jQuery UI對話框中的ASP.NET用戶控件
- 4. 定位JQuery用戶界面對話框點擊附近鏈接
- 5. 如何在用戶點擊<img>時顯示對話框?
- 6. 角度2:防止用戶點擊模式對話框外部
- 7. 更改PrimeFaces對話是在客戶端
- 8. 按鈕點擊後jQuery對話框點擊asp.net mvc 2
- 9. tiinymce下拉菜單點擊聚合物對話框時點擊
- 10. 點擊應用上QtQuick對話框按鈕關閉對話框
- 11. 對話框中的jQueryUI對話框輸入不可點擊
- 12. WiX中的新對話框,點擊返回跳過對話框
- 13. Widget在點擊時啓動對話框
- 14. JSFL:抑制/自動點擊對話框
- 15. 點擊後關閉對話框
- 16. 點擊jquery對話框外的鏈接
- 17. 對話框不會彈出點擊jquery
- 18. CKEDITOR對話框 - 按鈕點擊
- 19. 無法使對話可點擊
- 20. 在GridView上打開對話框點擊
- 21. 當點擊它時關閉對話框
- 22. 對話框中的可點擊鏈接
- 23. 事件點擊Android外部對話框?
- 24. 對話框菜單不響應點擊
- 25. 上點擊一個jQueryUI的對話框
- 26. 點擊一次打開對話框
- 27. 客戶端會話
- 28. 黑客:禁用點擊與jQuery點擊
- 29. bootstrap點擊通話
- 30. 我想在客戶端點擊重置鏈接時向客戶端顯示ModalDialogbox