在平板电脑的屏幕方向 [英] Screen orientation in tablet

查看:173
本文介绍了在平板电脑的屏幕方向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在用同样的code为平板电脑和手机,我想要写XLARGE屏幕,横向的应用程序。我写了一个条件,但是,当我可以旋转到肖像生成异常。

I am using the same code for both tablets and mobile, and I want to write an app for Xlarge screens with landscape. I wrote one condition but when I am rotating into portrait it generates an exception.

我已经宣布了条件:

final boolean isPortrait = getResources().getConfiguration().orientation ==Configuration.ORIENTATION_PORTRAIT;

我想code。如果使用其他条件XLARGE和横向但它应该工作仅平板电脑,但同时来移动它不应该与工作

I want code with if else condition using xlarge and landscape orientations but it should work for only tablets but while coming to mobile it should not work.

推荐答案

有两种方法使应用程序全屏显示。该第一简单地陈述了应用程序支持特定的DPI。清单中的以下code支持所有的干粉吸入器。

There are two methods to make an application full screen. The first simply states the application supports a specific dpi. The following code in the Manifest supports all dpis.

 <supports-screens android:smallScreens="true" 
              android:normalScreens="true" 
              android:largeScreens="true"
              android:xlargeScreens="true"
              android:anyDensity="true" />

这篇关于在平板电脑的屏幕方向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆