我有类似于 "There are 200€" 的内容,但我想要对值进行样式化(例如,textColor 红色)
有没有办法让两个 textView 看起来像一个完整的textView?
在 textView 中嵌套另一个 textView 或者 textView 容器等。
我可以像这个回答中所示实现它:Change text color of one word in a TextView
但我想从布局文件中实现。有什么机会吗?
谢谢
编辑
<TextView
android:id="@+id/lastIncome"
android:text="Tu último ingreso fueron"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/dash_font_size"/>
<TextView
android:id="@+id/lastIncomeValue"
android:text="200€"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/dash_value_font_size"
android:textColor="@color/greensea"
android:layout_gravity="right"/>