更改按钮的方向,让活动仅保留在一个方向

时间:2016-12-22 14:14:31

标签: android button camera orientation preview

假设当前android的活动设置为:

 android:screenOrientation="sensorPortrait"

有没有办法只更改按钮的方向?所以其他孩子保持相同的方向,如android manifest中所述。

我要问的是拉伸相机预览。只要 android:screenOrientation 设置为某些值,如横向纵向,那么切换到不同的方向并不会真正影响相机预览,比例和尺寸都很完美。但是,当只是删除这个 screenOrientation 部分,以使按钮随手机旋转,以便他们按照更改方向....横向预览拉伸像x2.5时间,使预览看起来很糟糕。

1 个答案:

答案 0 :(得分:0)

对于所有可能寻找答案的人,关于陈述的问题,有明智的方法来实现这一目标,只需按照上述主题进行操作

Rotate an ImageButton on orientation change

How to rotate views on orientation change without recreating layout?