Вы можете установить высоту вашего ImageView
, чтобы получить то, что вы хотите.Чтобы установить его программно, вы можете сделать это на getView()
вашего пользовательского адаптера:
public View getView(int position, View convertView, ViewGroup parent) {
View cv = convertView;
if (convertView == null) {
cv = inflater.inflate(R.layout.listview_item, null);
}
ImageView venueImage = (ImageView) cv.findViewById(R.id.venueImage);
LinearLayout.LayoutParams vi_params = new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, (int)(screenHeight*0.33);
venueImage.setLayoutParams(vi_params);
return cv;
}
Вы можете получить высоту экрана, добавив этот код в основное занятие:
int screenHeight = ((WindowManager)context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getHeight();