摘要:
在adapter的getView中给view设置布局参数时,使用下面方法: LayoutParams params = new LayoutParams( LayoutParams.FILL_PARENT, (int) (metrics.heightPixels * 0.23f + 0.5f)); convertView.setLayoutParams(params);程序会出现错误06-08 15:39:43.071: E/AndroidRu... 阅读全文
摘要:
http://developer.android.com/reference/android/util/DisplayMetrics.htmlDisplayMetrics metric = new DisplayMetrics();getWindowManager().getDefaultDisplay().getMetrics(metric);int width = metric.widthPixels;// 屏幕宽度(像素)int height = metric.heightPixels;// 屏幕高度(像素)float density= metric.density;// 屏幕密度(0. 阅读全文