【发布时间】:2017-02-15 18:14:00
【问题描述】:
所以我目前正在制作基于 GoogleMaps 的游戏。因为我想制作相机,所以我需要整个谷歌地图的像素大小。
这就是我的意思:
我已经试过了:
// pre generated by android studios
// Obtain the SupportMapFragment and get notified when the map is ready to be used.
mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
mapFragment.getMapAsync(this);
int width = mapFragment.getView().getMeasuredWidth();
int height = mapFragment.getView().getMeasuredHeight();
String widthAndHeight = width+" "+height;
但它只返回null。 sn-p有什么问题?还有其他方法可以计算谷歌地图的全尺寸吗?或者这只是返回当前显示的地图部分的大小?
【问题讨论】:
-
发布答案:D,比我要除外。
标签: java android google-maps google-maps-api-3