2013年8月28日

Android获取屏幕大小

摘要: 本来想着如下方法就能得到了Display display = getWindowManager().getDefaultDisplay(); Log.i("view", "height:"+display.getHeight()); Log.i("view","width:"+display.getWidth()); DisplayMetrics displayMetrics = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetr 阅读全文

posted @ 2013-08-28 20:45 在旅途 阅读(1992) 评论(0) 推荐(1)

Exception: java.lang.ClassCastException: android.widget.RelativeLayout$LayoutParams

摘要: RelativeLayout title_bg = (RelativeLayout)FTU_Bluetooth.this.findViewById(R.id.titlebar); LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, 0x55); title_bg.setLayoutParams(params);如果用RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(i... 阅读全文

posted @ 2013-08-28 18:53 在旅途 阅读(772) 评论(0) 推荐(0)

导航