我正在尝试在Android中旋转包含WebView的FrameLayout,以下是我的代码:
我正在尝试在Android中旋转包含WebView的FrameLayout,以下是我的代码:
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);
旋转功能正常,但问题在于webview中的任何可点击区域都不会根据布局的旋转坐标系更改其坐标。此外,webview的滚动也被反转。
有什么建议可以解决这个问题吗?