我有一个TextView,其中有一个硬编码的字符串,我有一个动态变量,想将其放在该字符串的末尾。这是我的代码:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp">
<TextView
android:id="@+id/PeopleName"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/Generic_Text"+"@{ Profile.name }" />
</LinearLayout>
我遇到了问题,与 android:text="@string/Generic_Text"+"@{ Profile.name }"
有关。 Generic_Text
为 " My Name is ",然后Profile.name
是动态的,在不同的个人资料中会有所更改。我希望整个 TextView 输出为My Name is {Profile.name}。任何帮助都将不胜感激。