【发布时间】:2020-12-15 18:00:22
【问题描述】:
我在谷歌地图片段上定位TextView,如下所示:
private fun putTextView() {
val layout : FrameLayout = findViewById(R.id.frameLayout)
val textView : TextView = TextView(this)
textView.textSize = 14F
textView.text = " some text "
textView.setTextColor(Color.BLACK)
textView.setPaddingRelative(100,100,0,0)
layout.addView(textView)
}
它确实出现在我希望它出现的位置,但是当我在地图上拖动时,TextView 不会跟随移动,而是停留在屏幕上的同一位置。如何让它在我拖动时跟随地图的移动?
【问题讨论】:
标签: android kotlin google-maps-android-api-2