首页 \ 问答 \ 开发通用的Android应用程序(手机和平板电脑) - 定义方向(Developing an universal android application (phone and tablet) - Defining Orientations)

开发通用的Android应用程序(手机和平板电脑) - 定义方向(Developing an universal android application (phone and tablet) - Defining Orientations)

我开发了一个Android应用程序,它只支持纵向方向,适用于Android手机。 现在,我需要修改这个应用程序,因为我想做通用版本(对于平板电脑),但我有一个问题。 手机版仅支持纵向,平板电脑版支持纵向和横向。 有没有办法为平板电脑和手机定义不同的方向?

谢谢


I have developed an android application, which only supports portrait orientation, for android phones. Now, I need to modify this app because I want to do the universal version (for tablets, too) but I have a problem. The phone version only supports portrait orientation and the tablet version supports portrait and landscape orientations. Is there any way to define different orientations for tablets and phones?

Thanks


原文:https://stackoverflow.com/questions/6872135
更新时间:2023-03-20 06:03

最满意答案

Jess确实包含了一种能够操作Java对象的传统编程语言,但Jess所做的主要部分是允许您编写声明性规则。 这是一种完全不同的编程范式。 在传统的命令式语言中,您编写的代码可以明确地告诉计算机如何解决问题。 另一方面,在声明性语言中,您描述了问题,语言本身就会找出解决问题的方法。 因为Jess本身是用Java编写的,所以说Jess比Java本身或多或少更强大是没有意义的:它只是一种不同的编程方法,它使得解决某些类问题更容易。


Jess does include a traditional programming language with the ability to manipulate Java objects, But the main part of what Jess does is allow you to write declarative rules. This is a completely different programming paradigm. In a traditional imperative language you write code that tells the computer explicitly how to solve a problem. In a declarative language, on the other hand, you describe the problem, and the language itself figures out how to solve it. Because Jess itself is written in Java, it makes no sense to say that Jess is more or less powerful than Java itself: it's just a different approach to programming, and it makes solving certain classes of problems easier.

相关问答

更多
  • 您可以将所有更改的规则放入命名模块中 (focus Changes Report1 Report2) You could put all the changing rules into a named module and (focus Changes Report1 Report2)
  • Jess lambdas不是闭包,所以执行函数时?x不可用。 在Jess中愚弄执行顺序的方法是评估字符串; 我们想在函数返回时将函数的值硬编码到函数中,因此我们需要在函数汇编时评估?x。 这样的东西可以正常工作: (deffunction fn-less-than(?x) (eval (str-cat "(lambda (?arg) (< ?arg " ?x "))"))) Jess lambdas aren't closures, so ?x isn't available when the f ...
  • 如果您在使用xml中的值获取正确的间距时遇到问题,可以尝试查看以下教程: http://spragucm.wordpress.com/2013/11/17/android-horizontal-and-vertical-gridview-tutorial/ 我专门写了它,因为双向gridview项不会均匀分布,它们不会填充行/列。 我的教程中的示例代码允许您设置列和行号,并为您完成其他所有操作,以便子项填充行/列,并在项之间添加一些填充。 示例代码演示了如何在任一方向上使用双向gridview。 至于设置o ...
  • 不知道#Person的模板是如何定义的,这很难,但从你描述的行为我推断#hasParent是一个多时隙。 因此,使用此: (defrule FindBobChildren (object (is-a #Person) (OBJECT ?oi) (#hasParent $? ?b&:(eq (instance-name ?b)(instance-name #Bob)) $? ) ) => (printout t "Bob childre ...
  • 实际上,我认为错误信息非常清楚; 没有名为price的函数,但表达式(price ?product ?price)被解释为通过该名称调用函数。 我理解你想要getTotalPrice做什么,但我无法理解你的实现; 我认为你误解了apply函数的作用 - 也许你会把它与其他语言中类似命名的函数混淆。 无论如何,在Jess中编写getTotalPrice的方法是使用查询; 看到这里了解那些。 Actually the error message is pretty clear, I think; there's ...
  • Jess有一个非常规律的语法,这与您尝试模拟的Java语法完全不同。 所有“运算符”实际上都是函数,并且使用与函数调用相同的前缀语法。 它总是(op arg1 arg2 ...) 。 圆括号总是围绕整个表达式,而不仅仅是参数。 例如,在Jess中,Java表达式a < b总是(< ?a ?b) 。 没有&&运算符,而是有一个and函数。 因此, if (a < b && c > d) ...看起来像(if (and (< ?a ?b) (> ?c ?s)) then ...在Jess中。 Jess has ...
  • 你想要的Jess功能是 (mod ) 至于学习Jess,我听说,Earnest Friedman-Hill的书(不在互联网上,AFAIK)仍然是最好的。 但是Jess附带的手册非常好,你可以从中学到很多东西。 由于Jess是一个Lisp方言,你可以从Lisp的任何教程中学习。 然后,浏览参考,只是为了了解可用的内容。 The Jess function you want is (mod
  • 一次断言一个阶段: (deffacts initial-phase (phase choose-gender)) 并确保在所有输入后断言排序阶段: (deffunction ask-start-again () (printout t "Enter another person? (y/n) ") (if (eq (read) y) then (assert (phase choose-gender)) else (assert (phase sort-persons)))) ...
  • Jess确实包含了一种能够操作Java对象的传统编程语言,但Jess所做的主要部分是允许您编写声明性规则。 这是一种完全不同的编程范式。 在传统的命令式语言中,您编写的代码可以明确地告诉计算机如何解决问题。 另一方面,在声明性语言中,您描述了问题,语言本身就会找出解决问题的方法。 因为Jess本身是用Java编写的,所以说Jess比Java本身或多或少更强大是没有意义的:它只是一种不同的编程方法,它使得解决某些类问题更容易。 Jess does include a traditional programmi ...
  • “灿......上学吗?” - >是的,这就是你拥有import语句的原因。 请参阅Jess手册。 (deftemplate Record (declare (from-class Record))) 这声明了一个事实类型Record作为类Record *的影子事实 。 这在Jess手册中进行了讨论和解释。 “我认为...?” - >不,这条规则是完全正确和可取的。 "Can...class?" -> Yes, that's why you have the import statement. See t ...

相关文章

更多

最新问答

更多
  • python的访问器方法有哪些
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。
  • 响应navi重叠h1和nav上的h1链接不起作用(Responsive navi overlaps h1 and navi links on h1 isn't working)
  • 在C中读取文件:“r”和“a +”标志的不同行为(Reading a File in C: different behavior for “r” and “a+” flags)
  • NFC提供什么样的带宽?(What Kind of Bandwidth does NFC Provide?)
  • 元素上的盒子阴影行为(box-shadow behaviour on elements)
  • Laravel检查是否存在记录(Laravel Checking If a Record Exists)
  • 设置base64图像的大小javascript - angularjs(set size of a base64 image javascript - angularjs)
  • 想学Linux 运维 深圳有哪个培训机构好一点
  • 为什么有时不需要在lambda中捕获一个常量变量?(Why is a const variable sometimes not required to be captured in a lambda?)
  • 在Framework 3.5中使用服务器标签<%=%>设置Visible属性(Set Visible property with server tag <%= %> in Framework 3.5)
  • AdoNetAppender中的log4net连接类型无效(log4net connection type invalid in AdoNetAppender)
  • 错误:发送后无法设置标题。(Error: Can't set headers after they are sent. authentication system)
  • 等待EC2实例重启(Wait for an EC2 instance to reboot)
  • 如何在红宝石中使用正则表达式?(How to do this in regex in ruby?)
  • 使用鼠标在OpenGL GLUT中绘制多边形(Draw a polygon in OpenGL GLUT with mouse)
  • 江民杀毒软件的KSysnon.sys模块是什么东西?
  • 处理器在传递到add_xpath()或add_value()时调用了什么顺序?(What order are processors called when passed into add_xpath() or add_value()?)
  • sp_updatestats是否导致SQL Server 2005中无法访问表?(Does sp_updatestats cause tables to be inaccessible in SQL Server 2005?)
  • 如何创建一个可以与持续运行的服务交互的CLI,类似于MySQL的shell?(How to create a CLI that can interact with a continuously running service, similar to MySQL's shell?)
  • AESGCM解密失败的MAC(AESGCM decryption failing with MAC)
  • SQL查询,其中字段不包含$ x(SQL Query Where Field DOES NOT Contain $x)
  • PerSession与PerCall(PerSession vs. PerCall)
  • C#:有两个构造函数的对象:如何限制哪些属性设置在一起?(C#: Object having two constructors: how to limit which properties are set together?)
  • 平衡一个精灵(Balancing a sprite)
  • n2cms Asp.net在“文件”菜单上给出错误(文件管理器)(n2cms Asp.net give error on Files menu (File Manager))
  • Zurb Foundation 4 - 嵌套网格对齐问题(Zurb Foundation 4 - Nested grid alignment issues)
  • 湖北京山哪里有修平板计算机的