Google Maps Android API V2 blacking out part of layout

前端 未结 8 1413
-上瘾入骨i
-上瘾入骨i 2021-02-04 13:48

I\'m trying to integrate Google Maps Android API v2 into my Android Application. I\'m placing the Google Map in the middle of my layout. It works great when the layout is able t

8条回答
  •  再見小時候
    2021-02-04 14:43

    Just an experiment, but have you tried adding the TextView to the screen programmatically in setupMap() after the Map has already been initialized?

    // First, get a handle on the parent RelativeLayout, 
    // call it parentRelativeLayout, then…                  
    
    TextView textView = new TextView(getActivity());
    RelativeLayout.LayoutParams textLayout = new RelativeLayout.LayoutParams(
        RelativeLayout.MATCH_PARENT, 
        RelativeLayout.MATCH_PARENT
    );
    textLayout.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, -1);
    textView.setLayoutParams(textLayout);
    
    parentRelativeLayout.addView(textView)
    

提交回复
热议问题