zoukankan      html  css  js  c++  java
  • 安卓

    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不能用

  • 相关阅读:
    mysql
    新建mysql容器
    Storm中并行度原来是这样计算的(1.0.1版本)
    集中式系统和分布式系统
    hadoop错误:Does not contain a valid host:port authority
    Linux配置ntp时间服务器(全)
    vi/vim 消除搜索后的关键字高亮
    雄鹰与蜗牛
    如何查看HBase的HFile
    MemoryUsage:监测java虚拟机内存使用
  • 原文地址:https://www.cnblogs.com/-chaoming/p/6860344.html
Copyright © 2011-2022 走看看