private LinearLayout baseLayout; //目標控件所在的佈局 private Context context; private Button btn1; //即將動態添加的按鈕
btn1 = new Button(context); btn1.setText("動態添加按鈕");
baseLayout = (LinearLayout)findViewById(R.id.BaseLayout); baseLayout.addView(btn1);
private LinearLayout baseLayout; //目標控件所在的佈局 private Context context; private Button btn1; //即將動態添加的按鈕
btn1 = new Button(context); btn1.setText("動態添加按鈕");
baseLayout = (LinearLayout)findViewById(R.id.BaseLayout); baseLayout.addView(btn1);
01 背景介紹 在智能手機市場上,高端機型經常備受矚目,但低端機型亦佔據了不可忽視的份額。衆多廠商爲滿足低端市場的需求,不斷推出低配系列手機。另外過去幾年的中高端