So setzen Sie die Ansichtsbreite programmatisch in Android ein

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