以上是我想要的输出的一个例子。请注意,由John对准到右侧上的报价的最后一行。
Above is an example of the output I want. Notice that "by John" is aligned to the right on the last line of the quote.
如果没有足够的空间,那么我想作者出现在一个新的生产线,但还是右对齐。
If there's not enough space, then I would like the author to appear on a new line, but still be right aligned.
使用这样的:希望这会工作,你
use this : hope this will work you
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffffff"
android:orientation="horizontal"
android:padding="5dip" >
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="2dp"
android:text="Loren ipsum Loren ipsum Loren ipsum Loren ipsum Loren ipsum Loren Loren n ipsum Loren ipsum Loren ipsum Loren Loren ipsum"
android:textColor="#454545"
android:textSize="9sp" />
<TextView
android:id="@+id/by"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="15dp"
android:text="by john"
android:textColor="#454545"
android:layout_marginTop="14dp"
android:textSize="9sp" />
</RelativeLayout>
上一篇:使用getApplicationContext()显示对话框 - BadTokenException:无法添加窗口对话框、窗口、getApplicationContext、BadTokenExcep