我想在文本結尾(@ + id/isi_ayat)之後添加框架數字(@ + id/number_ayat),但如果我使用它TextView中。那麼如何在文本結尾後添加數字和框架呢?如何在文本視圖後添加數字和框架
這是我在custom_isi_ayat.xml
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:paddingTop="10dp"
>
<LinearLayout
android:padding="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:textSize="20dp"
android:id="@+id/number_ayat"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginRight="10dp"
android:background="@drawable/frame"
android:gravity="center" />
<TextView
android:gravity="left"
android:textAlignment="textStart"
android:id="@+id/isi_ayat"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="30dp" />
</LinearLayout>
<TextView
android:id="@+id/translate_bahasa"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:paddingLeft="20dp"
android:id="@+id/terjemahan"
android:textStyle="italic"
android:lineSpacingMultiplier="0.7"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
代碼捕獲結果:in capture result :
,我想結果是:and I want to result is
這是否可以用java解決?
在此先感謝您對我的問題的幫助!
對不起啓動mmarginStart argin只改變number_ayatonly的位置,而不是將文本 –
的number_ayatto結束時,我編輯的答案完全地。當你可以的時候看看。 – Juan
對不起,我只是有時間來回復,我試過了,結果是固定的,數字不完全在文本的末尾,他只是在文本元素的左側,這可以用java解決嗎? @Juan –