I'm trying to show a TextView in a FrameLayout when the marker is visible.
Like in the code below:
FrameLayout frameLay = new FrameLayout(context); FrameLayout.LayoutParams layoutParamsFrame = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.FILL_PARENT, FrameLayout.LayoutParams.FILL_PARENT); frameLay.setLayoutParams(layoutParamsFrame); TextView theText = new TextView(context); theText.setText("text_test"); theText.setTextColor(Color.WHITE); theText.setTypeface(Typeface.DEFAULT_BOLD); LayoutParams layoutParamsText = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); theText.setLayoutParams(layoutParamsText); theText.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM); first = true; frameLay.addView(theText);
This does not work for me. The marker is visible and I execute this code, but nothing happens. How can I fix this?