#1.控件

1.1 TextView
基础属性:
image-20211201091134013

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical">

<TextView

android:text="@string/tv_one" //设置文本
android:textColor="@color/black" //设置字体颜色
android:textStyle="italic" //设置字体样式
android:textSize="30sp" //设置字体大小
android:background="@color/red"
android:gravity="center" //设置文本位置
android:id="@+id/tv_one" //设置id
android:layout_width="200dp"
android:layout_height="200dp"

></TextView>


</LinearLayout>

1.2 带阴影的TextView
image-20211201102222982

1
2
3
android:shadowColor="@color/red"
android:shadowRadius="3.0"
android:shadowDx="10.0"

1.3 跑马灯效果

image-20211201102435535

1
2
3
4
5
6
7
8
 android:singleLine="true"
android:ellipsize="marquee"
android:marqueeRepeatLimit="marquee_forever"
android:focusable="true"
android:focusableInTouchMode="true"
android:clickable="true"

<requestFocus/>