尺寸等级专为肖像3.5英寸(iPhone 4S)XCode 6? [英] Size class specifically for portrait 3.5 inch (iPhone 4S) XCode 6?
问题描述
我正在调整我的UI应用程序,但是我遇到了一个我无法解决的问题。
I'm tuning my UI App, but I got an issue that I can't solve.
我可以看到紧凑型高度会影响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我不能让事情变小,因为我正在处理恰好只有的pickerviews UIPickerView的三个有效高度(162.0,180.0和216.0)。尺寸和约束分开。
@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.
所以我知道它远离Goodville,不要打击我,只是为了分享:
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屋!