【发布时间】:2012-01-25 07:52:33
【问题描述】:
我正在尝试在 android 中旋转包含 webview 的框架布局,这是我的代码:
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的滚动也被反转了
关于如何解决此问题的任何建议
【问题讨论】:
-
也许你需要像触摸事件代码here这样的东西。
标签: android view webview android-framelayout rotation