textView的属性scrollbars
分为vertical 垂直滚动
horizontal 水平滚动
是实现项目的核心属性
代码
xml文件
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity">
<TextView
android:id="@+id/control"
android:text="点击添加英雄台词,长按删除全部台词"
android:layout_width="match_parent"
android:gravity="center"
android:layout_height="wrap_content"
android:layout_marginTop="20dp