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

  • 相关阅读:
    从服务器角度分析RPG游戏——NPC的AI
    羽翼特效设计
    坐骑特效设计(二)
    坐骑特效设计
    Unity AssetBundle打包资源工具
    有趣的进度条
    原生与组件
    bower
    yeoman
    grunt+bower+yo
  • 原文地址:https://www.cnblogs.com/-chaoming/p/6860344.html
Copyright © 2011-2022 走看看