1.マップビュー注釈setCalloutView()は、ポップアップバブルのサイズを制御できません。
解決策:膨張するビューのサブビューの高さと幅を設定すると、バブルのサイズを制御できます。
AnnotationView AnnotationView = new AnnotationView(annotation 、context); contentView = LayoutInflaterを表示します。from(context).inflate(R.layout.content_annotation_jingq 、null); DisplayMetrics displayMetrics = context .getResources()。getDisplayMetrics(); int width = displayMetrics。widthPixels / 2 ; ビューll = contentView.findViewById(R.id.ll_xxx); LinearLayout.LayoutParams p =(LinearLayout.LayoutParams)ll.getLayoutParams(); p。幅=幅; ll.setLayoutParams(p);
2.scrollViewネストされたmapviewスライディングイベントの競合。
解決策:mapviewのOntouchイベントをオーバーライドします。
MapViewの.getChildAt(0).setOnTouchListener(新しいView.OnTouchListener(){ @Override 公共ブールonTouch(ビューV 、 MotionEventイベント){ 場合(event.getAction()== MotionEvent。ACTION_UP){ scrollView .requestDisallowInterceptTouchEvent(偽); } else { scrollView .requestDisallowInterceptTouchEvent(true); } return false; } });