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="羽毛球"/>

  • 相关阅读:
    Django的认证系统
    Django 中间件
    Django Form和ModelForm组件
    AJAX
    Django中ORM介绍和字段及字段参数
    Django ORM那些相关操作
    Python中应该使用%还是format来格式化字符串?
    Cookie、Session和自定义分页
    ORM版学员管理系统3
    ORM版学员管理系统2
  • 原文地址:https://www.cnblogs.com/tianwenjing123-456/p/12313331.html
Copyright © 2011-2022 走看看