Android - 设置带滚动条的TextView
16lz
2021-01-23
在布局文件中设置TextView属性(Android:scrollbars):
<TextViewandroid:id="@+id/text_log"android:layout_width="match_parent"android:layout_height="wrap_content"android:textSize="18sp"android:singleLine="false"android:maxLines="20"android:scrollbars="vertical"/>
在代码中关联该TextView:
TextViewtextLog=(TextView)this.findViewById(R.id.text_log);textLog.setMovementMethod(ScrollingMovementMethod.getInstance());
更多相关文章
- android -布局控件禁用多点触控
- 在AndroidManifest.xml文件中的android:windowSoftInputMode属性
- Android应用程序安装过程源代码分析(4)
- Android 获取AndroidManifest.xml文件versionCode,versionName属
- ImageView的属性android:scaleType,即ImageView.setSca...
- Android TabLayout导航条属性的设置