了解boundCenterBottom()

Ham*_*amy 6 android google-maps overlay

我正在尝试复制ItemizedOverlay.boundCenterBottom()我的一个Overlay类中的行为.

我相当肯定我可以使用setBounds(),但我完全迷失了setBounds()实际做的事情.

Ham*_*amy 8

我相信我找到了答案

mapIcon_ = mapView.getResources().getDrawable(R.drawable.map_marker_v);

mapIcon_.setBounds(-mapIcon_.getIntrinsicWidth() / 2,
                   -mapIcon.getIntrinsicHeight(), 
                    mapIcon_.getIntrinsicWidth() / 2,
                    0);
Run Code Online (Sandbox Code Playgroud)