Watch 1 Star 0 Fork 0

海的那边 / learn

Create your Gitee Account
Explore and code with more than 5 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Without author's permission, this code is only for learning and cannot be used for other purposes.
教学笔记 spread retract

Clone or download
activity_text_view.xml 3.19 KB
Copy Edit Web IDE Raw Blame History
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activity.sample.TextViewActivity">
<!--默认样式-->
<TextView
android:id="@+id/tv_default"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="大家好,我是默认的TextView显示样式。大家好,我是默认的TextView显示样式。大家好,我是默认的TextView显示样式。大家好,我是默认的TextView显示样式"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!-- android:lineHeight="30dp"-->
<TextView
android:id="@+id/tv_line_height"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:lineHeight="30dp"
android:text="大家好,我是设置了lineHeight=30dp的TextView显示样式,使用该属性后lineSpacingExtra和lineSpacingMultiplier都将无效。该属性需要SDK>=28时才能使用"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_default" />
<!-- android:lineSpacingExtra="10dp"-->
<TextView
android:id="@+id/tv_line_spacing_extra"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:lineSpacingExtra="10dp"
android:text="大家好,我是设置了lineSpacingExtra=10dp的TextView显示样式。大家好,我是设置了lineSpacingExtra=10dp的TextView显示样式。"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_line_height" />
<!-- android:lineSpacingMultiplier="1.5"-->
<TextView
android:id="@+id/tv_line_spacing_multiplier"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:lineSpacingMultiplier="1.5"
android:text="大家好,我是设置了lineSpacingMultiplier=1.5的TextView显示样式。大家好,我是设置了lineSpacingMultiplier=1.5的TextView显示样式。"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_line_spacing_extra" />
<!--android:letterSpacing="0.5"-->
<TextView
android:id="@+id/tv_letter_space"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:letterSpacing="0.5"
android:text="大家好,我是设置了letterSpacing=0.5的TextView显示样式。该属性需要SDK>=21时才能使用"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_line_spacing_multiplier" />
</android.support.constraint.ConstraintLayout>

Comment ( 0 )

Sign in for post a comment

1
https://gitee.com/goldsea/learn.git
git@gitee.com:goldsea/learn.git
goldsea
learn
learn
master

Search