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++;
            }
        }
    }
     
    程序员喜欢的方式,纯代码方式。
  • 相关阅读:
    C# DataSet导出Excel
    MVC学习十四:MVC 路由 Route
    【Ubuntu 16.04.2_64】安装配置SVN
    【Java Web开发学习】Spring MVC 使用HTTP信息转换器
    【Git】常用命令
    【Git】安装配置
    【Git】学习开始
    【JPA】映射
    【JPA】字段访问、属性访问及混合访问
    【JPA】注解@PostConstruct、@PreDestroy
  • 原文地址:https://www.cnblogs.com/catzhou/p/3579895.html
Copyright © 2011-2022 走看看