<Android学习笔记7>——Android基本控件的使用

来源:互联网 发布:什么是关键词优化 编辑:程序博客网 时间:2024/05/21 14:51

TextView:
多行文本显示时,可以适当使用滚动条。基本用法如下:

布局中

            <TextView            android:id="@+id/tv_introduce"            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:layout_marginTop="10dp"            android:textColor="#8B4513"            **android:scrollbars="vertical"            android:singleLine="false"**            android:textSize="20sp" />

在Acticity中

hosIntroduce = (TextView) view.findViewById(R.id.tv_introduce);  // 文字很多,显示不出来时,加上滚动条   hosIntroduce.setMovementMethod(ScrollingMovementMethod.getInstance());
0 0
原创粉丝点击