专为纵向 3.5 英寸 (iPhone 4S) Xcode 6 设计的尺寸等级? [英] Size class specifically for portrait 3.5 inch (iPhone 4S) Xcode 6?

查看:15
本文介绍了专为纵向 3.5 英寸 (iPhone 4S) Xcode 6 设计的尺寸等级?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在调整我的 UI 应用程序,但我遇到了一个我无法解决的问题.

I'm tuning my UI App, but I got an issue that I can't solve.

正如我所见,Compact 高度会影响所有 4.7 英寸以下的 iPhone,但我的 UI 很好,除了 iPhone 4S(3.5 英寸).

As I can see Compact height affects all iPhones under 4.7 inches, but my UI is fine except for the iPhone 4S (3.5 inches).

我不想修改所有 4.7 英寸以下 iPhone 的布局,只修改 iPhone 4S,同时我不想遗漏这台设备.

I don't want to modify the layout for all iPhones under 4.7 inches, just the iPhone 4S, at the same time I don't want to left out this device.

有什么解决方法可以让我设置修改,但仅适用于 3.5 英寸的肖像?还是我应该告别 1 亿台设备?

There's any workaround so I can set the amendments but just and only for the 3.5 inches portrait? or should I say goodbye to 100 millions devices out there?

我知道这是一个棘手的问题,几乎是一次民意调查,但从技术上讲,我想在这里找到最好的出路.

I know it's a tough question and almost an opinion poll, but technically speaking I would like to find my best way out here.

推荐答案

@all 我不能让事情变得更小,因为我正在处理 UIPickerView 只有三个有效高度(162.0、180.0 和 216.0)的pickerviews).大小和约束分开.

@all I can't make things smaller, because I'm dealing with pickerviews which happen to have only three valid heights for UIPickerView (162.0, 180.0 and 216.0). Sizes and constraints apart.

iPhone 尺寸:http://www.idev101.com/code/User_Interface/sizes.html,4S是独一无二的.

iPhone Sizes: http://www.idev101.com/code/User_Interface/sizes.html , 4S is unique.

因此,尽管我的方法有点丑陋,但我的观点差不多.

So although my approach it's a little bit ugly get the things done, nearly on my point.

所以我知道它离古德维尔很远,不要打我,只是为了分享:

So I know it's far from Goodville, don't hit me down, just for sharing:

func checkForiPhone4S()
{
    if (UIScreen.mainScreen().bounds.size.height == 480) {
        println("It is an iPhone 4S - Set constraints")

        listPickerView.transform = CGAffineTransformMakeScale(1, 0.8);

        var constraintHeight = NSLayoutConstraint(item: listPickerView, attribute: NSLayoutAttribute.Height, relatedBy: NSLayoutRelation.Equal, toItem: nil, attribute: NSLayoutAttribute.NotAnAttribute, multiplier: 1, constant: 100)

        self.view.addConstraint(constraintHeight)

        datePickerView.transform = CGAffineTransformMakeScale(1, 0.8);

        var constraintHeightDate = NSLayoutConstraint(item: datePickerView, attribute: NSLayoutAttribute.Height, relatedBy: NSLayoutRelation.Equal, toItem: nil, attribute: NSLayoutAttribute.NotAnAttribute, multiplier: 1, constant: 100)

        self.view.addConstraint(constraintHeightDate)

    }
}

这篇关于专为纵向 3.5 英寸 (iPhone 4S) Xcode 6 设计的尺寸等级?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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