首页 > 其他 > 详细

1.基本控件 TextView基本操作

时间:2021-09-06 01:28:19      阅读:22      评论:0      收藏:0      [点我收藏+]
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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=".MainActivity">

<TextView
android:id="@+id/tv_one"
android:text="@string/tv_one"
android:textColor="@color/myColor"
android:textStyle="italic"
android:textSize="30sp"
android:background="#FFFF00"
android:gravity="bottom"
android:layout_width="200dp"
android:layout_height="200dp"/>

<!-- android:textStyle="bold" 粗体
android:textStyle="italic" 斜体
字体sp单位是为了适应不同的设备,自适配-->

</LinearLayout>


我们正规的添加颜色或者字符串要在xml文件中写,然后要用的时候引入即可

技术分享图片

 

 

 技术分享图片

 

 

 

属性太多记不住怎么办????

技术分享图片

按住ctrl 鼠标左键点击进去

 技术分享图片

 

 好的 我们下节课学习阴影

 

1.基本控件 TextView基本操作

原文:https://www.cnblogs.com/tuyaojiao/p/15226191.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!