Два textview в макете кадра? - PullRequest
1 голос
/ 19 марта 2019

Символ пробела не совпадает с символом текста. Как это решить?

<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginBottom="10dp">

<TextView
android:textSize="12sp"
android:fontFamily="@font/opensans_regular"
android:id="@+id/tv_tag"
android:textColor="@color/dark_indigo"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

<TextView
android:textSize="12sp"
android:fontFamily="@font/opensans_regular"
android:id="@+id/tv_content"
android:textColor="@android:color/black"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

</FrameLayout>

Java:

String tag = "#" + modelReply.getTag();
tv_tag.setText(tag);
String startSpace = "";
for(int j = 0; j <= tag.length(); j++){
startSpace += " ";
}
String content = startSpace + modelReply.getComment_content();

tv_content.setText(content);

Первый стиль просмотра текста отличается от второго стиля. Поэтому я поместил их в frameLayout. Но два textview перекрывают друг друга ..

Edit: Я хочу показать два textview как один textview.

...