• 安卓


    1.开发Activity步骤
        第一步:写一个类继承Activity
        第2步:重写oncreate方法
        第3步:在主配置文件中注册Activity
            <activity android:name=".类名"
                      android:label="@string/app_name">
                <intent-filter>
                    <!-- app的入口>
                    <action android:name="android.intent.action.MAIN" />
                    <!-- 桌面显示-->
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
    2.Activity常用方法
         View findViewById(int id)   //根据组件的ID取得组件对象
         setContentView(int layoutResID) //设置布局文件,设置显示组件
    3.TextVies
        android:maxLength = "6"            //允许最大字符数
        android:textColor = "#FF0000"       //文字颜色
        android:textSize = "50px"            //文字的大小
        android:textStyle = "bold"           //文字样式
        android:password = "true"                //是否以密文方式显示
        android:layout_margin = "100px"         //外边距  
        android:background = "@drawable/a"     //背景
        android:id = "@+id/id值"               //设置id的值


        getText().toString()    //获得控件的文本内容
        setText                 //设置控件的文本内容
     注意 :<!-- -->
     4.Button
     5.EditText
          android:enabled = "false"  //设置是否可用,false不能用

  • 相关阅读:
    编程及应用中的一些快捷键(持续更新中)
    html5入门(head部分的基本认识)
    html5入门(j简单了解html)
    动态规划 ship
    js 解决两值交换
    styled-components解决全局样式'injectGlobal' 废除的问题
    mysql sql更新密码失败
    window nginx 基础命令
    MySQL 8.0
    "unexpected console statement” in Node.js
  • 原文地址:https://www.cnblogs.com/-chaoming/p/6860344.html
Copyright © 2020-2023  润新知