我尝试在java代码中设置宽度和高度,如下所示:
ViewGroup.LayoutParams params=new LayoutParams(500,200);
mMapView.setLayoutParams(params);
mMapView.invalidate();
但是执行代码时会出现一些错误:
02-02 06:04:20.126: E/AndroidRuntime(1043): java.lang.ClassCastException: android.view.ViewGroup$LayoutParams