【问题标题】:TextView in setTextAppearance() android-maps-utils 0.4.4 always transparentsetTextAppearance() android-maps-utils 0.4.4 中的 TextView 始终透明
【发布时间】:2017-01-05 10:59:38
【问题描述】:

在 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 的可见性。

【问题讨论】:

    标签: android android-mapview android-maps-utils


    【解决方案1】:

    我按照这里的描述解决了: https://github.com/googlemaps/android-maps-utils/issues/315

    在此处复制/粘贴我的答案: 经过几次挖掘提交后,我注意到 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);

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-02-11
      • 1970-01-01
      • 1970-01-01
      • 2012-02-08
      • 2021-04-20
      • 2015-09-06
      • 1970-01-01
      • 2015-09-07
      相关资源
      最近更新 更多