0
我有這個textviews如何使文本的一部分TextView的大膽
((TextView)findViewById(R.id.carmodel)).setText("CarModel: " + getCarModel+"");
((TextView)findViewById(R.id.bikemodel)).setText("BikeModel: " + getBikeModel+"");
有沒有一種方法,大膽只是CarModel:
和BikeModel:
? 這是xml文件
<TextView
android:id="@+id/carmodel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textSize="17sp"
android:textStyle="italic"
android:layout_marginLeft="10dp"
android:text=""
android:textAppearance="?android:attr/textAppearanceSmall" />
<TextView
android:id="@+id/bikemodel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textSize="17sp"
android:textStyle="italic"
android:layout_marginLeft="10dp"
android:text=""
android:textAppearance="?android:attr/textAppearanceSmall" />
所以getCarModel和getBikeModel將是斜體和CarModel
和BikeModel:
大膽..
我已經編輯我的問題,並且增加了XML – Goro
可能是第二種方式會幫助我,但如何把它們放在一排?因爲如果我爲粗體文本製作一個文本視圖而另一個數據則在不同的行上? – Goro
我相信你正在使用垂直方向的lineraLayout。你需要使用linearLayout和水平方向。 – Ankit