底部没有小三角形的地图标记信息窗口 [英] Map marker info window without small triangle at bottom
问题描述
我需要在底部显示没有小三角形的Google地图标记的Infowindow。请检查我附加的图像。
我尝试了通过更改setInfoWindowAnchor进行设置,但它不起作用。任何人都可以帮助我吗?
marker_info.setInfoWindowAnchor(0,0)
为了使用speechbubble,请使用 为了不使用speechbubble,使用 示例1: 示例2: 注,这是使用的info_window.xml布局文件: I need to show an Infowindow of a Google map marker without the small triangle at the bottom. Please check the image which I have attached. I tried by setting by changing setInfoWindowAnchor but it didn't work. Can anyone help me on this?
In order to use the speechbubble, use the In order to not use the speechbubble, use Example 1: Result: Example 2: Result: Note, here is the info_window.xml layout file used:
这篇关于底部没有小三角形的地图标记信息窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! getInfoContents()$ c
getInfoWindow()
override。
public class MyCustomInfoWindowAdapter implements GoogleMap.InfoWindowAdapter {
private final查看myContentsView;
MyCustomInfoWindowAdapter(){
myContentsView = getLayoutInflater()。inflate(
R.layout.info_window,null);
}
@Override
public View getInfoWindow(Marker marker){
return null;
$ b @Override
public View getInfoContents(Marker marker){
TextView tvTitle =((TextView)myContentsView
.findViewById( R.id.txtTitle));
TextView tvSnippet =((TextView)myContentsView
.findViewById(R.id.txtSnippet));
tvTitle.setText(marker.getTitle());
tvSnippet.setText(marker.getSnippet());
返回myContentsView;
$ / code $ / pre
$ b $结果:
public class MyCustomInfoWindowAdapter实现GoogleMap.InfoWindowAdapter {
private final查看myContentsView;
MyCustomInfoWindowAdapter(){
myContentsView = getLayoutInflater()。inflate(
R.layout.info_window,null);
}
@Override
public View getInfoWindow(Marker marker){
TextView tvTitle =((TextView)myContentsView
.findViewById(R.id。 txtTitle));
TextView tvSnippet =((TextView)myContentsView
.findViewById(R.id.txtSnippet));
tvTitle.setText(marker.getTitle());
tvSnippet.setText(marker.getSnippet());
返回myContentsView;
}
@Override
public View getInfoContents(Marker marker){
return null;
$ / code $ / pre
$ b $结果:
<?xml version =1.0encoding =utf-8 >?;
< LinearLayout xmlns:android =http://schemas.android.com/apk/res/android
android:layout_width =match_parent
android:layout_height =match_parent
android:padding =20dp
android:orientation =vertical
android:background =#000000>
TextView
android:id =@ + id / txtTitle
android:textColor =#D3649F
android:textStyle =bold
android:layout_width =wrap_content
android:layout_height =wrap_content/>
TextView
android:id =@ + id / txtSnippet
android:textColor =#D3649F
android:layout_width =wrap_content
android:layout_height =wrap_content/>
< / LinearLayout>
marker_info.setInfoWindowAnchor(0,0)
getInfoContents()
override.getInfoWindow()
override. public class MyCustomInfoWindowAdapter implements GoogleMap.InfoWindowAdapter {
private final View myContentsView;
MyCustomInfoWindowAdapter() {
myContentsView = getLayoutInflater().inflate(
R.layout.info_window, null);
}
@Override
public View getInfoWindow(Marker marker) {
return null;
}
@Override
public View getInfoContents(Marker marker) {
TextView tvTitle = ((TextView) myContentsView
.findViewById(R.id.txtTitle));
TextView tvSnippet = ((TextView) myContentsView
.findViewById(R.id.txtSnippet));
tvTitle.setText(marker.getTitle());
tvSnippet.setText(marker.getSnippet());
return myContentsView;
}
}
public class MyCustomInfoWindowAdapter implements GoogleMap.InfoWindowAdapter {
private final View myContentsView;
MyCustomInfoWindowAdapter() {
myContentsView = getLayoutInflater().inflate(
R.layout.info_window, null);
}
@Override
public View getInfoWindow(Marker marker) {
TextView tvTitle = ((TextView) myContentsView
.findViewById(R.id.txtTitle));
TextView tvSnippet = ((TextView) myContentsView
.findViewById(R.id.txtSnippet));
tvTitle.setText(marker.getTitle());
tvSnippet.setText(marker.getSnippet());
return myContentsView;
}
@Override
public View getInfoContents(Marker marker) {
return null;
}
}
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="20dp"
android:orientation="vertical"
android:background="#000000">
<TextView
android:id="@+id/txtTitle"
android:textColor="#D3649F"
android:textStyle="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/txtSnippet"
android:textColor="#D3649F"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>