Code example for AbsoluteLayout

Methods: addView

0
//    	checkbox = (CheckBox)findViewById(R.id.id_checkbox); 
//    	cv = (CanvasView)findViewById(R.id.canvas_textview); 
    } 
    void initialComponentsManul() 
    { 
    	AbsoluteLayout alayout = new AbsoluteLayout(this);
    	setContentView(alayout);
        //����һ��button��ť 
    	cv = new CanvasView(this);
        //cv.setText("this is a button"); 
        cv.setId(1);
        //ȷ������ؼ��Ĵ�С��λ�� 
        int width = this.getWindowManager().getDefaultDisplay().getWidth();
        int height = this.getWindowManager().getDefaultDisplay().getHeight();
       AbsoluteLayout.LayoutParams lp1 = 
                                 new AbsoluteLayout.LayoutParams(
                                      width - 30,
                                      height - 60,
                                      0,0); 
       alayout.addView(cv, lp1 );
    } 
    private CanvasView cv;
    private CheckBox checkbox;
     
} 
Contextual code suggestions in your IDE  Get Codota for Java