Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/212.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android TextView-在它运行时启动新行';s位于另一个文本视图的右侧_Android_Textview - Fatal编程技术网

Android TextView-在它运行时启动新行';s位于另一个文本视图的右侧

Android TextView-在它运行时启动新行';s位于另一个文本视图的右侧,android,textview,Android,Textview,我如何使textview开始一个新行,一直向左,但同时保留“TotherRightOf”username25属性 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height=

我如何使textview开始一个新行,一直向左,但同时保留“TotherRightOf”username25属性

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <TextView
        android:id="@+id/model_rv_videoactivity_username"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="username25:"
        android:textStyle="bold"
        android:paddingLeft="12dp"
        android:paddingRight="6dp"/>
    <TextView
        android:id="@+id/model_rv_videoactivity_message"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textColor="@color/colorBlackFont"
        android:text="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
        android:layout_toRightOf="@+id/model_rv_videoactivity_username"/>

</RelativeLayout>

像这样:


我猜twitch应用程序使用HTML格式。本质上是使用HTML来设置文本的特定部分的样式,并将文本的不同部分注入到一个文本视图中

也许可以看看这个:


您可以使用HTMl设置字符串的
username25:
部分的样式,然后在一个文本视图中将消息部分连接到它

他们在用户名上有一个监听器,虽然这样会出现一个屏幕,而不是消息部分。这可能有用,在这种情况下,那么:这也可能对你有用,我想:哇,我甚至不知道这一点。你学的越多!谢谢分享