public class Test0812Activity extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main);AbsoluteLayout layer = (AbsoluteLayout)findViewById(R.id.AbsoluteLayout01);CheckBox btt = new CheckBox(this);layer.addView(btt);btt.setText("4567");btt.layout(100, 100, 200, 200);btt.postInvalidate();}}為什么生成的CheckBox總是出現(xiàn)在左上角,而不是layout函數(shù)中規(guī)定的100,100,200,200?需要怎么改可以解決這個(gè)問題?
Android編程中關(guān)于layout(l,t,r,b)函數(shù)的問題?
炎炎設(shè)計(jì)
2018-11-14 19:15:20