사용자가 모바일의 방향을 변경할 때마다 경고를 표시하려고합니다. 이 mouvement를 캡처하는 방법이 있습니까? 나는 Display.getOrientation();
을 사용합니다. 하지만 항상 다른 방향으로 32를 반환합니다.제어 화면 방향 blackberry
0
A
답변
0
참고 :
public class checkOrientation
{
VerticalFieldManager manager;int ori;
public checkOrientation()
{
ori=Display.getOrientation();
manager=new VerticalFieldManager()
{
protected void sublayout(int maxWidth, int maxHeight) {
super.sublayout(Display.getWidth(),Display.getHeight());
setExtent(Display.getWidth(),Display.getHeight());
if(ori!=Display.getOrientation()){
UiApplication.getUiApplication().invokeLater(new Runnable() {
public void run() {
ori=Display.getOrientation();
Dialog.inform(""+Display.getOrientation());
}
});
}
}
};
add(manager);
}
}
: 당신이 방향을 확인할 때 당신은 현명한 다른 실 거예요 다음 코드
시도 일 9800 시뮬레이터에서 슬라이더를 닫아야
3
오리엔테이션이 변경되면 sublayout()
으로 전화가 걸립니다. 변수에 displaywidth
을 저장할 수 있으며 값이 sublayout()
에서 변경된 경우 방향이 변경되었음을 알 수 있습니다.
이와같이.
protected void sublayout(int width, int height) {
if(Display.getWidth()==oldWidth)
{
//no change
}
else
{
// orientation changed
}
oldWidth = Display.getWidth();
super.sublayout(width, height);
}
관련 문제
- 1. 화면 방향
- 2. Prototype 툴팁 - "방향 제어"
- 3. BlackBerry 자력계 방향 - 어느 방향으로?
- 4. 화면 방향 변경
- 5. ANDROID 화면 방향 변경
- 6. Silverlight의 화면 방향 고정
- 7. Android - 화면 방향 변경
- 8. iOS 초급 : 화면 방향
- 9. AsyncTask의 화면 방향 처리
- 10. Android 화면 방향 센서
- 11. 화면 방향 처리
- 12. 안드로이드의 화면 방향
- 13. 안드로이드의 화면 방향
- 14. 화면 방향 잠그기
- 15. 화면 방향 및 조각
- 16. 화면 방향 변경을위한 의도
- 17. 화면 방향 처리 - 안드로이드
- 18. iPhone 화면 방향 감지
- 19. DreamService의 화면 방향 잠금
- 20. 태블릿의 화면 방향
- 21. 정지 화면 방향
- 22. BlackBerry WebWorks의 화면 해상도
- 23. Blackberry WebWorks : 방향 변경 후 높이가 잘못됨
- 24. 뷰 플리퍼 사용시 방향 제어
- 25. WP7의 제어 화면 밝기
- 26. Windows Mobile : 화면 방향 및 해상도 처리
- 27. android ViewSwitcher 화면 방향 변경
- 28. 화면 방향 변경 문제 : onCreate
- 29. 안드로이드 기기의 기본 화면 방향
- 30. 공유 환경 설정 화면 방향