Check out example codes for "set view layout params android". It will help you in understanding the concepts better.

Code Example 1

yourView.setLayoutParams(new LinearLayout.LayoutParams(
                    //change the parameters as whatever you want
//keep in mind that LinearLayout is not the only Layout, e.g. you can use ConstrainLayout etc...
//after, you need to add yourView to a layout as it won't redraw itself if you just change the layout parameters e.g.:
yourLayout.addView(yourView); //yourView will pop on yourLayout

Learn ReactJs, React Native from