我想在文本结尾(@ + 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 –