我在 TextView 中有一个长文本,例如“你好,你好吗\n这是我的‘第二个活动’。”。我只想将“第二个活动”文本设为可点击。
我在 ScrollView 中使用 TextView 像这样:
<ScrollView android:id="@+id/scrollView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/gold_btn" android:orientation="vertical"><TextView android:id="@+id/text1" android:layout_width="match_parent" android:layout_height="wrap_content" android:textColor="#FFEFFF" android:text="" android:textSize="23sp"/></ScrollView>
并使用 text1.setText("Hello How Are You This Is my Second Activity"); 在代码中设置文本 我想让“第二个活动”文本可点击,当用户点击“第二个活动”文本时,另一个活动将打开。
字符串很长,也有新的行。