zoukankan      html  css  js  c++  java
  • 第一课 Hello

    using System;
    using Android.App;
    using Android.Content;
    using Android.Runtime;
    using Android.Views;
    using Android.Widget;
    using Android.OS;
    using Android.Util;
     
    namespace MyLesson
    {
        [Activity(Label = "Lesson1", MainLauncher = true, Icon = "@drawable/icon")]
        public class Lesson1 : Activity
        {
            int count = 1;
            TextView tv;
     
            protected override void OnCreate(Bundle bundle)
            {
                base.OnCreate(bundle);
                LinearLayout layout = new LinearLayout(this);
                layout.Orientation = Orientation.Vertical;
                tv = new TextView(this);
                tv.Text = "Hello";
                Button b = new Button(this);
                b.Text = "Click me";
                b.Click += b_Click;
     
                layout.AddView(tv);
                layout.AddView(b);
                SetContentView(layout);
            }
     
            void b_Click(object sender, EventArgs e)
            {
                tv.Text = "Click times:" + count;
                count++;
            }
        }
    }
     
    程序员喜欢的方式,纯代码方式。
  • 相关阅读:
    <JZOJ5912>VanUSee
    <JZOJ5910>duliu
    <JZOJ5913>林下风气
    pytest学习笔记(二)
    试用saucelabs进行浏览器兼容性测试
    pytest学习笔记(一)
    SSM框架搭建,以及mybatis学习
    游戏2048的python实现
    使用svn在github上下载文件夹
    jenkins集成python的单元测试
  • 原文地址:https://www.cnblogs.com/catzhou/p/3579895.html
Copyright © 2011-2022 走看看