TextView属性的简单使用

TextView大全有许多,先学着几个,做个简单例子。不用多说,先看看效果:

这里写图片描述

带阴影字体效果代码:

<TextView
        android:layout_marginTop="5dp"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:shadowColor="#F9F9F900"
        android:shadowDx="2.0"
        android:shadowDy="2.0"
        android:shadowRadius="3.0"
        android:text="带阴影的字体"
        android:textColor="#6f7"
        android:textSize="32sp" />

矩形布局代码:

<TextView
        android:layout_marginTop="15dp"
        android:layout_width="200dp"
        android:layout_height="60dp"
        android:background="@drawable/textview1"
        android:gravity="center"
        android:text="矩形"
        android:textColor="#8f9"
        android:textSize="33sp" />

圆形布局代码

<TextView
        android:layout_width="200dp"
        android:layout_height="60dp"
        android:layout_marginTop="25dp"
        android:background="@drawable/textview2"
        android:gravity="center"
        android:text="圆形"
        android:textColor="#89ff89"
        android:textSize="33sp" />

网络链接只要设置android:autoLink=”web”

跑马灯效果:

<TextView
        android:layout_marginTop="45dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:ellipsize="marquee"
        android:focusable="true"
        android:focusableInTouchMode="true"
        android:marqueeRepeatLimit="marquee_forever"
        android:singleLine="true"
        android:text="TextView属性有许多,简单玩一玩,呵呵呵呵呵呵呵呵呵呵"
        android:textSize="20sp" />
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值