摘要: class Program { static void Main(string[] args) { string word = "10"; int a = word.CustomToInt(); Console.WriteLine(a); } } /// <summary> /// 扩展方法(类和方法均为static) /// 使用的时候要引用该类的命名空间 /// </summary> public static class Demo ... 阅读全文
posted @ 2012-02-13 17:57 麦芽糖! 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 1.不用编写代码,直接更改main.xml和strings.xml(1)main.xml 代码<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <ListView android:id=" 阅读全文
posted @ 2012-02-13 15:20 麦芽糖! 阅读(331) 评论(0) 推荐(0) 编辑
摘要: 1.MainActivity.javapublic class MainActivity extends Activity{ private Button btnClick = null; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); btnClick = (Button) findViewById(R.id.btnClic... 阅读全文
posted @ 2012-02-13 14:20 麦芽糖! 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 1.main.xml<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > < 阅读全文
posted @ 2012-02-13 13:56 麦芽糖! 阅读(275) 评论(0) 推荐(0) 编辑