0

i have created a custom view

CameraView extends View{
     .....
  } 

in OnCreate methode i have define as

    cameraView = new CameraView(this);
                LayoutParams layoutParamsCamera 
                    = new LayoutParams(LayoutParams.MATCH_PARENT, 
                            LayoutParams.MATCH_PARENT);

                this.addContentView(cameraView, layoutParamsCamera);

but this use full screen i need to use as marginBootom= 20dp or paddingBoototm= 20dp

so how i can add this parameter to LayoutParams??

i need help & sorry for my bad English

Sumit
  • 1,022
  • 13
  • 19

1 Answers1

0

Use MarginLayoutParams instead of whatever flavor of LayoutParams you're now using to set view layout margins programmatically.

laalto
  • 150,114
  • 66
  • 286
  • 303