ANDROID笔记:TextView的简单使用

 1 <?xml version="1.0" encoding="utf-8"?> 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 3     android:layout_width="match_parent" 4     android:layout_height="match_parent" 5     android:orientation="vertical" > 6  7     <!-- 跑马灯 --> 8  9 10     <TextView11         android:id="@+id/textView1"12         android:layout_width="100dp"13         android:layout_height="wrap_content"14         android:ellipsize="marquee"15         android:focusable="true"16         android:focusableInTouchMode="true"17         android:marqueeRepeatLimit="marquee_forever"18         android:singleLine="true"19         android:text="adsfsadfsdafsdfdsadddddddaaaaaaaaaaaaa" />20     <!-- 链接邮箱 -->21 22     <TextView23         android:id="@+id/textView2"24         android:layout_width="100dp"25         android:layout_height="wrap_content"26         android:autoLink="email"27         android:text="110@qq.com" />28     <!-- 链接拨号 -->29 30     <TextView31         android:id="@+id/textView3"32         android:layout_width="100dp"33         android:layout_height="wrap_content"34         android:autoLink="phone"35         android:text="1383838438" />36     <!-- 链接浏览器 -->37 38     <TextView39         android:id="@+id/textView4"40         android:layout_width="100dp"41         android:layout_height="wrap_content"42         android:autoLink="web"43         android:text="www.baidu.com" />44     <!-- 阴影 -->45 46     <TextView47         android:id="@+id/textView5"48         android:layout_width="100dp"49         android:layout_height="wrap_content"50         android:shadowColor="#0000ff"51         android:shadowDx="20"52         android:shadowDy="0"53         android:shadowRadius="3"54         android:text="测试阴影"55         android:textColor="#ff0000"56         android:textSize="30sp" />57 58 </LinearLayout>

实现跑马灯的主要属性:

android:ellipsize="marquee"

android:focusable="true"

android:focusableInTouchMode="true"

android:marqueeRepeatLimit="marquee_forever"

android:singleLine="true"

TextView超出部分的省略号属性:

android:ellipsize="end"

更多相关文章

  1. android去掉layout顶部的阴影(状态栏下边的阴影)
  2. Android属性动画优化
  3. Android阴影
  4. 设置图片缩放方法失效 解决办法设置android:scaleType属性
  5. android PopupWindow 阴影背景 、动画 、点击显示、隐藏
  6. 相对布局的一些属性
  7. Android如何自定义视图属性总结

随机推荐

  1. android 开源播放器与编码器
  2. Android中ListView注意事项
  3. Android Studio3.1.2使用总结
  4. Android周笔记(9.8-14)(持续更新)
  5. Android之SystemUI加载流程和NavigationB
  6. Android(安卓)开发 ide 快捷键
  7. Android中播放GIF图片动画
  8. Widget的点击事件
  9. Android使用libgdx实现模拟方向键控制角
  10. 2011.06.07——— android 1.6 launcher