【发布时间】:2016-06-26 17:52:33
【问题描述】:
目前我正在尝试正确显示图像/视频 (How can i rotate image and video if it was captured in landscape mode?),作为解决方案之一,我看到了这个(覆盖屏幕旋转方法并阻止某些元素使用它)。
可以吗?
我可以随时调用元素的旋转吗?
【问题讨论】:
标签: android rotation screen-orientation screen-rotation
目前我正在尝试正确显示图像/视频 (How can i rotate image and video if it was captured in landscape mode?),作为解决方案之一,我看到了这个(覆盖屏幕旋转方法并阻止某些元素使用它)。
可以吗?
我可以随时调用元素的旋转吗?
【问题讨论】:
标签: android rotation screen-orientation screen-rotation
您是否尝试过使用 ViewStub 并针对当前屏幕方向为该元素附加布局?
ViewStub stub = (ViewStub) findViewById(R.id.stub);
if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
stub.setLayoutResource(R.layout.landscape);
} else {
stub.setLayoutResource(R.layout.portrait);
}
【讨论】: