Мой пользовательский вид информационного окна:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:cardCornerRadius="7dp"
app:cardElevation="2dp">
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="test" />
</androidx.cardview.widget.CardView>
</LinearLayout>
, тогда я использую его:
map.setInfoWindowAdapter(new GoogleMap.InfoWindowAdapter() {
@Override
public View getInfoWindow(Marker arg0) {
View v = getLayoutInflater().inflate(R.layout.layout_marker_title, null);
TextView tv_title = v.findViewById(R.id.tv_title);
tv_title.setText(arg0.getTitle());
return v;
}
@Override
public View getInfoContents(Marker arg0) {
return null;
}
});
Но у карты, кажется, нет тени, как обычно. Игра с возвышением или переводом cardview Z не помогает.
почему тень cardview не работает на картах Google?
Каков наилучший или самый простой способ создать тень для моего пользовательского информационного окна?