一起学习安卓开发,你也可以!!!
有帮助的话记得一键三连,点赞收藏关注,持续更新哦~
前言
本文介绍了在Android移动开发中如何使用Android Studio对字体进行颜色和大小控制。
一、页面布局
在xml文件中放置一个Textview组件和三个按钮进行字体颜色和大小的控制。
代码如下:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<TextView
android:id="@+id/tv_show"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"/>
<Button
android:id="@+id/btn_chg_color"
an