I am trying to rotate a framelayout containing a webview in android, here is my code:
FrameLayout contentView = (FrameLayout) getRootView().findViewById( R.id.content); FrameLayout backGround = new FrameLayout(getContext()); FrameLayout.LayoutParams bgfl = new FrameLayout.LayoutParams( FrameLayout.LayoutParams.FILL_PARENT, FrameLayout.LayoutParams.FILL_PARENT); backGround.addView(WebView object); contentView.addView(backGround, bgfl); RotateAnimation r = new RotateAnimation(0f, -90f,Animation.RELATIVE_TO_SELF,0.5f, Animation.RELATIVE_TO_SELF,0.5f); r.setDuration(0); r.setFillAfter(true); LayoutAnimationController animController = new LayoutAnimationController(r, 0); backGround.setLayoutAnimation(animController);
It rotates normally ... but the problem is that any interactive area in the web view does not change its coordinates in accordance with the rotated coordinate system of the layout. In addition, web scrolling is viewed from the back.
Any suggestion on how to fix this problem
source share