[Android] Fragment Width(넓이)

Posted by Find my true self Fimtrus
2014.02.06 18:09 Programming/Android
mRootLayout.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
	@Override
	public void onGlobalLayout() {
		mFragmentWidth = getView().getWidth();
		mFragmentHeight = getView().getHeight();
		if (mFragmentWidth > 0) {
			ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, mFragmentWidth);
			mMapView.setLayoutParams(params);
		}
	}
});
이 댓글을 비밀 댓글로