【发布时间】:2015-10-19 19:51:11
【问题描述】:
在我的谷歌地图应用程序中,我在不同的位置使用自定义标记。我成功实现了这一点,但我需要动态增加自定义标记的大小。我使用了以下代码
imgView.getLayoutParams().height = 200;
imgView.getLayoutParams().width = 200;
代码在某些设备中运行良好,但在 nexus4 和 5 中,标记非常大。请帮我解决问题
自定义标记 XMl
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<ImageView
android:layout_width="36dp"
android:layout_height="36dp"
android:src="@drawable/marker" />
<TextView
android:layout_width="36dp"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:gravity="center"
android:textColor="#FFFFFF"
android:textSize="14sp"
android:textStyle="bold" />
</RelativeLayout>
【问题讨论】:
-
如何设置xml中的layoutparams?也许有体重?
-
请检查我的自定义标记 XML
标签: android google-maps google-maps-markers