修复了Marker展示内容过多的问题

This commit is contained in:
董宏宇
2020-01-15 14:44:56 +08:00
parent e7aa921dfa
commit 2a297ae83f
2 changed files with 8 additions and 3 deletions

View File

@@ -125,7 +125,13 @@ public class MapMarkerInfoView extends MapMarkerBaseView {
break;
}
if (!TextUtils.isEmpty(markerShowEntity.getTextContent())) {
tvMarkerContent.setText(markerShowEntity.getTextContent());
String content;
if (markerShowEntity.getTextContent().length() > 8) {
content = markerShowEntity.getTextContent().substring(0, 7) + "...";
} else {
content = markerShowEntity.getTextContent();
}
tvMarkerContent.setText(content);
}
} catch (Exception e) {

View File

@@ -58,7 +58,6 @@
android:layout_marginLeft="@dimen/dp_10"
android:ellipsize="end"
android:gravity="center"
android:maxLength="8"
android:singleLine="true"
android:textColor="#ffffff"
android:textSize="@dimen/sp_32"
@@ -66,7 +65,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/ivUserHead"
app:layout_constraintTop_toTopOf="@+id/ivUserHead"
tools:text="诗一样的女子诗诗一样的女子诗诗一样的女子诗" />
tools:text="诗一样的女子" />
</androidx.constraintlayout.widget.ConstraintLayout >
<ImageView