zoukankan      html  css  js  c++  java
  • Android Studio(4)

    1、文本框组件:

    <TextView
    android:layout_width="match_parent" 适应屏幕宽度
    android:layout_height="wrap_content" 适应内容高度
    android:text="@string/text1" 文字内容
    android:textSize="40sp" 设置字体大小
    android:textColor="#0fabe5" 设置字体颜色
    android:singleLine="true"/> 设置文本框单行

    2、编辑框组件:

    <EditText
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:hint="请输入名称"
    android:inputType="textPassword" 格式为密码
    android:lines="3"/> 编辑框的行数为3

    3、普通按钮:用于触发一个动作

    添加单击事件监听器:

     

    如下图:

     4、单选按钮:

    <RadioGroup
    android:id="@+id/radiogroup1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">

    <RadioButton
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="一年级"/>
    <RadioButton
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="二年级"/>

    <RadioButton
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="三年级 "/>
    </RadioGroup>

     5、复选框:

    <CheckBox
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="篮球"/>
    <CheckBox
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="足球"/>
    <CheckBox
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="乒乓球"/>
    <CheckBox
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="羽毛球"/>

  • 相关阅读:
    CENTOS安装部署zabbix
    分解XML方法
    Git使用摘要
    POJ 1274 The Perfect Stall 水二分匹配
    [leetcode]Pascal&#39;s Triangle II
    swift学习笔记(六)析关闭过程和使用分配给属性的默认值
    Qt学习一门:直接使用QT具
    mybatis13 resultMap
    mybatis12 Usermapper.xml
    mybatis11 sqlMapConfig.xml文件说明
  • 原文地址:https://www.cnblogs.com/tianwenjing123-456/p/12313331.html
Copyright © 2011-2022 走看看