使用view的旋转,键盘没有旋转,最后使用pda开启屏幕旋转,调用api实现竖屏旋转(横屏旋转暂时没有解决)
This commit is contained in:
@ -17,6 +17,7 @@ import java.net.SocketException;
|
||||
import java.util.Enumeration;
|
||||
|
||||
import chaoran.business.R;
|
||||
import chaoran.business.activity.MainActivity;
|
||||
|
||||
public class LocalAddressUtil {
|
||||
|
||||
@ -135,8 +136,17 @@ public class LocalAddressUtil {
|
||||
@SuppressLint("JavascriptInterface")
|
||||
@JavascriptInterface
|
||||
public void rotateScreen(int type) {
|
||||
view.setRotationX(type);
|
||||
view.setRotationY(type);
|
||||
// 使用的是view对象,旋转,出现的问题,键盘并没有出现旋转
|
||||
// view.setRotationX(type);
|
||||
// view.setRotationY(type);
|
||||
|
||||
// activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT);
|
||||
if (type == 0) {
|
||||
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT);
|
||||
}else {
|
||||
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
|
||||
}
|
||||
// System.out.println("MainActivity.rotate :: " + MainActivity.rotate);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user