zoukankan      html  css  js  c++  java
  • 2021/1/25

    TextView(文本框),用于显示文本的一个控件

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context=".MainActivity"
        android:gravity="center"
        android:background="#8fffad">
    
        <TextView
            android:id="@+id/txtOne"
            android:layout_width="200dp"
            android:layout_height="200dp"
            android:gravity="center"
            android:text="TextView(显示框)"
            android:textColor="#EA5246"
            android:textStyle="bold|italic"
            android:background="#000000"
            android:textSize="18sp" />
    
    </RelativeLayout>
    • id:为TextView设置一个组件id,
    • layout_width:组件的宽度
    • layout_height:组件的高度
    • gravity:设置控件中内容的对齐方向,TextView中是文字,ImageView中是图片
    • text:设置显示的文本内容
    • textColor:设置字体颜色,
    • textStyle:设置字体风格,
    • textSize:字体大小
    • background:控件的背景颜色,控件的颜色,可以是图片
  • 相关阅读:
    Linux下安装confluence汉化破解版
    某种可以解决一切问题的方法
    普通平衡树(treap)
    文艺平衡树(splay模板)
    [CQOI2015]任务查询系统
    [NOIP2016]天天爱跑步
    NOI2018_Day1_T1_归程
    Picture
    bzoj3524 Couriers
    bzoj2588 counting on a tree
  • 原文地址:https://www.cnblogs.com/qiangini/p/14864693.html
Copyright © 2011-2022 走看看