`
weimou66
  • 浏览: 1244751 次
文章分类
社区版块
存档分类
最新评论

在9530手机上面,如何控制程序只能纵向显示?如何判断当前的屏幕横纵方向呢?

 
阅读更多

程序之支持纵向大屏幕显示,不支持横向显示。怎么办?

在main()方法里面加入如下两行即可。

int directions = net.rim.device.api.system.Display.DIRECTION_NORTH;

net.rim.device.api.ui.Ui.getUiEngineInstance().setAcceptableDirections(directions);

程序中如何判断当前的屏幕横纵方向呢?
if(Display.getOrientation()== Display.ORIENTATION_LANDSCAPE)

{

///

}

if(Display.getOrientation()== Display.ORIENTATION_PORTRAIT)

///

参考:

How To - Control the screen orientation
Last Updated: 17 January 2009
Article Number: DB-00706

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800505/800608/How_To_-_Control_the_screen_orientation.html?nodeid=1487645&vernum=0

关键字:Storm,横屏,纵屏,屏幕,方向,控制

参考2:

BlackBerry 触摸屏设备编程

第2页,检测屏幕横纵方向

第9页,屏幕横纵切换的屏蔽

http://download.csdn.net/source/2562100

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics