How To Set View Width Programmatically In Android

[Solved] How To Set View Width Programmatically In Android | Swift - Code Explorer | yomemimo.com
Question : how to set view width programmatically in android

Answered by : attractive-addax-ptay7wwsjrdv

View view = findViewById(R.id.nutrition_bar_filled);
LayoutParams layoutParams = view.getLayoutParams();
layoutParams.width = newWidth;
view.setLayoutParams(layoutParams);

Source : https://stackoverflow.com/questions/10159372/android-view-layout-width-how-to-change-programmatically/10160317 | Last Update : Sun, 26 Apr 20

Answers related to how to set view width programmatically in android

Code Explorer Popular Question For Swift