카테고리 없음
DrawerLayout Match_parent 안먹힐때
코딩저장소
2016. 1. 29. 16:08
이런식으로 코드를 계산해서
가로를 화면 크기로 맞춰준다..
DisplayMetrics metrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metrics);
DrawerLayout.LayoutParams params = (DrawerLayout.LayoutParams) navigation_frame.getLayoutParams();
params.width = metrics.widthPixels;
navigation_frame.setLayoutParams(params);