了解boundCenterBottom()

时间:2010-01-20 23:05:42

标签: android google-maps overlay

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

我很确定我可以使用setBounds()执行此操作,但我完全不知道setBounds()实际上在做什么。

1 个答案:

答案 0 :(得分:8)

我相信我找到了答案

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

mapIcon_.setBounds(-mapIcon_.getIntrinsicWidth() / 2,
                   -mapIcon.getIntrinsicHeight(), 
                    mapIcon_.getIntrinsicWidth() / 2,
                    0);