Set the height and width of layout, programmatically in android

Create the layout
LinearLayout linearLayout= (LinearLayout)findViewById(R.id.numberPadLayout);

Gets the layout params that will allow you to resize the layout
LayoutParams Lparams =  linearLayout.getLayoutParams();

Changes the height and width by specified pixels
Lparams .height = 100;
Lparams .width = 100;

Comments

Popular posts from this blog

Flutter Bloc - Clean Architecture

Dependencies vs Dev Dependencies in Flutter

What's new in android 14?