0
我編程在Java類如何以編程方式添加谷歌地圖到的FrameLayout
FrameLayout mf = new FrameLayout(this);
mf.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, 200));
layContent.addView(mf);
取得了FrameLayout裏,我想用這個FrameLayout裏作秀GoogleMap的,這是我的GoogleMap
FragmentManager fm = getSupportFragmentManager();
SupportMapFragment supportMapFragment = SupportMapFragment.newInstance();
fm.beginTransaction().replace(xxxxxxx, supportMapFragment).commit();
代碼
如果我使用的FrameLayout從.XML,我們可以在添加ID替換(XXXXX,但現在我用的FrameLayout編程,那麼如何添加片段的GoogleMap以編程的FrameLayout?