Я только что внедрил обзор Listearlayout, но мне нужно определить высоту linearlayout (это должно быть 50% от высоты экрана). < /p>
< /code>
это возможно? Для работы над макетами. < /p>
Это мой код: < /p>
//capture the size of the devices screen
Display display = getWindowManager().getDefaultDisplay();
double width = display.getWidth();
//my EditText will be smaller than full screen (80%)
double doubleSize = (width/5)*4;
int editTextSize = (int) doubleSize;
//define the EditText
userName = (EditText) this.findViewById(R.id.userName);
password = (EditText) this.findViewById(R.id.password);
//set the size
userName.setWidth(editTextSize);
password.setWidth(editTextSize);
Подробнее здесь: https://stackoverflow.com/questions/679 ... creen-size