Android控件开发之TextView
16lz
2021-12-04
TextView控件就是一个字符串显示标签.
TextView效果:
文字左右滚动三个属性:
android:singleLine="true" android:ellipsize="marquee" android:marqueeRepeatLimit="marquee_forever"
本程序main.xml源码
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TextView android:id="@+id/textview" android:layout_width="wrap_content" android:layout_alignParentBottom="true" android:layout_height="wrap_content" android:fadingEdge="horizontal" android:scrollHorizontally="true" android:singleLine="true" android:ellipsize="marquee" android:marqueeRepeatLimit="marquee_forever" android:focusable="true" android:focusableInTouchMode="true" android:text="开始我们的Android开发之旅............................(*^__^*) 嘻嘻……" android:textSize="14dip" /> <!-- 如没有这不设置android:focusableInTouchMode="true" 我们会开始滚动一次 --></LinearLayout>
本程序java源码
package com.sx.TextView;import android.app.Activity;import android.os.Bundle;public class TextViewActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); }}
更多相关文章
- Android获取屏幕宽度与高度
- Android(安卓)源码编译 文件系统制作
- 从零开始学android开发- layout属性介绍
- Netty多语言(Java、Android(安卓)、C#、WebSocket)通信实例Demo (三
- 如何得到包含隐藏API的Android类库
- 【源码分享下载】每日更新之Android快速开发框架LoonAndroid
- Android磁盘管理-系统源码分析(1)
- Android属性动画ObjectAnimator源码简单分析
- Android实例收藏