比如LinearLayout.LayoutParams params=new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,440);我这样设置后在我的手机上显示的是完整的,在别的手机上显示不完整。
我也使用了网上搜到的方法:int screenHeight=getWindowManager().getDefaultDisplay().getHeight();
LinearLayout.LayoutParams params=new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,(int)(0.3*screenHeight));这个又没法算准百分比,真纳闷
Please use the tool class to convert dpi to px first and then set it up