在android-maps utils中从0.4.3到0.4.4之后,我无法在IconGenerator中为集群图标设置TextView样式。无论我使用什么样式(从lib还是我的styles.xml),TextView都是透明的。
public class MapRenderCustom extends DefaultClusterRenderer<T> {
public MapRenderCustom(Context context, GoogleMap map, ClusterManager<T> clusterManager) {
super(context, map, clusterManager);
new IconGenerator(contex).setTextAppearance(com.google.maps.android.R.style.ClusterIcon_TextAppearance);
}
}上面的代码在0.4.3版本中运行良好。但在0.4.4中,它不起作用(即使更改为amu_ClusterIcon_TextAppearance)。
应该为此负责的代码:https://github.com/googlemaps/android-maps-utils/commit/29490ad2cbc6bf2fb13fb7ac60eb8769c408bd51,但我不认为它会破坏TextView的可见性。
发布于 2016-09-27 23:17:49
我按照这里描述的方式解决了:https://github.com/googlemaps/android-maps-utils/issues/315
在这里复制/粘贴我的答案:在深入研究了commit之后,我注意到makeSquareTextView方法也发生了变化。从…
squareTextView.setId(R.id.text);
至
squareTextView.setId(R.id.amu_text);
这使得样式更改能够根据需要显示文本标签
从…
mIconGenerator.setTextAppearance(R.style.ClusterIcon_TextAppearance);
至
mIconGenerator.setTextAppearance(R.style.amu_ClusterIcon_TextAppearance);
https://stackoverflow.com/questions/39205798
复制相似问题