标签: landscape-portrait

iOS6更新后视图无法旋转到横向模式

Landscape (left home button)在我的-Info.plist文件中设置了界面方向,在更新到最新版本的xcode之前一切正常.模拟器现在运行iOS 6.当我在模拟器中启动我的应用程序时,它以纵向模式启动,但内容显示为应用程序不支持横向模式.它们向右旋转90度,内容不适合(我从不打算支持肖像模式)

任何想法在iOS 6中有什么变化以及如何让我的视图轮换?

orientation ipad ios ios-simulator landscape-portrait

7
推荐指数
1
解决办法
4669
查看次数

"UIScreen mainScreen] applicationFrame]"用于横向模式

我不得不问.运用

[[UIScreen mainScreen] applicationFrame]
Run Code Online (Sandbox Code Playgroud)

是一种以纵向模式获取iphone或ipad工作区的漂亮方式.但是,如果我想在横向上获得相同的大小,还有其他代码,或者我将不得不创建:

CGRect landscape = CGRectMake(0, 20, 1024, 748)
Run Code Online (Sandbox Code Playgroud)

这甚至不适用于iPhone和iPad.

iphone landscape objective-c ipad landscape-portrait

6
推荐指数
1
解决办法
2864
查看次数

jQuery Cycle 2响应中心幻灯片

我正在尝试使用优秀的Cycle 2 jQuery插件设置响应式图像库.画廊将展出肖像和风景图像.

我使用的是Centered Slides选项(Cycle2的中心插件:http://jquery.malsup.com/cycle2/demo/center.php),这似乎导致Webkit浏览器出现问题(尝试调整浏览器窗口大小,如果这不是'一开始很明显!)

http://goo.gl/NFFZk

绿色背景代表循环容器.

如果没有添加中心选项(data-cycle-center-horz = true data-cycle-center-vert = true),整个过程运行良好,请参阅:

http://goo.gl/p76wi

我无法弄清楚导致中心版本问题的原因.

图像上的CSS代码非常小:

.cycle-slideshow img {
    max-height: 100%;
    max-width: 100%;
}
Run Code Online (Sandbox Code Playgroud)

包含元素的CSS就在这里

.cycle-slideshow {
    background: green;
    display: block;
    position:absolute;
    height:auto;
    bottom:0;
    top:0;
    left:0;
    right:0;
    margin:20px auto;
    padding:0;
    width:80%;
    }
Run Code Online (Sandbox Code Playgroud)

非常感谢您的帮助!

jquery jquery-cycle landscape-portrait responsive-design

6
推荐指数
1
解决办法
6998
查看次数

在AndroidManifest.xml中设置screenOrientation不起作用

我有一个简单的hello world Android测试项目.在我的AndroidManifest.xml中,我已经设置好了

android:screenOrientation="portrait" 
android:configChanges="keyboardHidden|keyboard|orientation">
Run Code Online (Sandbox Code Playgroud)

但是当我调试我的代码时,变量isLandscape是真的,它应该是假的

boolean isLandscape = getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE;
Run Code Online (Sandbox Code Playgroud)

我知道我也可以通过代码设置活动方向,但出于某些原因我需要在xml中设置它.我该怎么做?

编辑:我的AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.androidgames.mreater"
android:versionCode="1"
android:versionName="1.0" 
android:installLocation="preferExternal">

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="17" />

<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

<application
    android:icon="@drawable/ic_launcher"
    android:allowBackup="true"
    android:label="Mr. Eater" >
    <activity
        android:name="com.androidgames.mreater.MrEaterGame"
        android:label="Mr. Eater" 
        android:screenOrientation="portrait"
        android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>
Run Code Online (Sandbox Code Playgroud)

我的实际onCreate活动方法:

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    boolean isLandscape = getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE;

    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);

    int frameBufferWidth = isLandscape ? 480 : 320;
    int frameBufferHeight = isLandscape …
Run Code Online (Sandbox Code Playgroud)

xml android orientation landscape-portrait android-activity

6
推荐指数
2
解决办法
2万
查看次数

如何使用故事板在ios5中设计纵向和横向的ui

如何在iphone或ipad中的界面构建器中设计ui(纵向和横向)(Iam使用storyboard而不是xib ..)..

提前致谢..

iphone storyboard landscape-portrait ios5

6
推荐指数
1
解决办法
7521
查看次数

横向旋转为纵向时的字体大小怪癖 - CSS媒体查询 - iPhone5 Safari

我已经用Google搜索了这个并且无法解决这个问题.谢谢你的帮助!!

Studiolynch.com.响应和流体布局.在iphone 5 Safari EXCEPT中完美运行,因为从横向模式旋转到纵向模式会使字体尺寸小于应有的尺寸.但是,如果您最初在纵向模式下加载页面,它可以完美地工作 - 也就是说,直到您旋转到横向然后再回到纵向.最容易看到"info"和"hello"页面上发生这种情况.

这是我正在使用的媒体查询:

@media only screen和(min-device-width:320px)和(max-device-width:480px)和(orientation:portrait)

css iphone safari media-queries landscape-portrait

6
推荐指数
1
解决办法
3946
查看次数

如何设置Word文档的页面方向?

我使用Apache POI XWPF来创建和处理MS Word文档.但我没有在文档中找到如何更改页面方向.

显然这种方式应该成功:

XWPFDocument doc = new XWPFDocument();

CTDocument1 document = doc.getDocument();
CTBody body = document.getBody();

if (!body.isSetSectPr()) {
     body.addNewSectPr();
}
CTSectPr section = body.getSectPr();

if(!section.isSetPgSz()) {
    section.addNewPgSz();
}
CTPageSz pageSize = section.getPgSz();

pageSize.setOrient(STPageOrientation.LANDSCAPE);
Run Code Online (Sandbox Code Playgroud)

但是这种方法不能正常工作.我可以将页面方向设置为横向,当我在代码中读取页面方向时,我会获得横向.行.但是,如果我打开保存的文件,我就是肖像格式.此设置实际上不起作用.可能是什么问题呢?

作为一种解决方法,我被迫开始使用横向或纵向格式手动创建的空白文档.但是我希望以所需的方向从头开始以编程方式创建文档.

例如,POI HSSF和XSSF具有在横向和纵向模式之间切换的功能.它是setLandscape()org.apache.poi.ss.usermodel.PrintSetup接口的方法.

但是,我们XWPF还是HWPF

java apache-poi orientation-changes landscape-portrait xwpf

6
推荐指数
1
解决办法
1万
查看次数

禁用iOS 7应用程序的横向方向?

第一次开发人员,只需设置证书即可在iOS设备上运行我的应用程序.

即使使用Autolayout设置,我的应用程序也无法在横向模式下很好地查看.如何禁止用户在转动设备时以横向方式查看应用程序?即无论设备的方向如何,它总是纵向?谢谢

编辑:苹果公司是否也建议不要在提交期间这样做?

ios landscape-portrait

6
推荐指数
2
解决办法
1万
查看次数

为什么我的iPad布局不能在旋转时重新调整?

我有一个适用于iPad的Split View控制器,它应该支持两种方向(纵向和横向).

问题是,当我更改设备的方向时,细节视图不会重新调整以使用整个空间,并且会出现灰色方块.

在此输入图像描述

我不认为这是约束的问题,因为这只有在我旋转时才会发生:

  • 当我以纵向模式启动应用程序时,布局加载良好.
  • 当我以横向模式启动应用程序时,布局加载良好.

在此输入图像描述

在SplitViewController(以及DetailsController)中我尝试了这段代码:

在viewDidLoad中:

 NSNotificationCenter.defaultCenter().addObserver(self, selector: "rotated", name: UIDeviceOrientationDidChangeNotification, object: nil)
Run Code Online (Sandbox Code Playgroud)

然后:

override func shouldAutorotate() -> Bool {
    print("should rotate --> true")
    return true
}

override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask {
    print("we support all orientations")
    return UIInterfaceOrientationMask.All
}

override func preferredInterfaceOrientationForPresentation() -> UIInterfaceOrientation {
    print("preferred orientation for presentation is landscape")
    return UIInterfaceOrientation.LandscapeLeft
}

func rotated(){
    print("rotatiooooonn ------------")
    refreshIpad()
    detailSplitViewController.refreshUI()
}

func refreshIpad (){
    dispatch_async(dispatch_get_main_queue(),{
        self.view.setNeedsLayout()
    })
}
Run Code Online (Sandbox Code Playgroud)

在日志中我得到了这个(所以每当方向发生变化时我都可以看到)

should rotate --> true
we support all …
Run Code Online (Sandbox Code Playgroud)

layout ipad ios landscape-portrait swift

6
推荐指数
1
解决办法
601
查看次数

iOS仅肖像应用程序从横向UIWebview youtube返回

我正在创建一个iOS application,我遇到了以下问题:

该项目设置为portrait模式应用程序.我有一个UIWebview,它加载一个带有youtube视频的网页.单击视频时,它将从中开始youtube player.当视频更改为landscape模式并单击"完成"时,它将返回UIWebview显示的状态landscape.

NSNotification视频完成后我确实收到了一个但是我无法强制portrait模式.

这应该是不可能的,我如何允许youtube进入landscape但强制应用程序保持portrait模式?或者还有另一种解决方法吗?

编辑:

在与Apple联系之后,它被证明是一个错误并被报道.

youtube uiwebview ios landscape-portrait

5
推荐指数
1
解决办法
1426
查看次数