TextView实现滚动
xml文件:
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1 <TextView 2 android:id="@+id/viewLocation" 3 android:layout_width="match_parent" 4 android:layout_height="120dp" 5 android:hint="now location" 6 android:scrollbars="vertical" 7 android:fadeScrollbars="false" 8 />
java代码:
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1 viewLocation = (TextView) findViewById(R.id.viewLocation); 2 viewLocation.setMovementMethod(ScrollingMovementMethod.getInstance());