我刚刚开始编写iOs应用程序以便工作,但遇到了这个问题,该问题与调整屏幕上的按钮大小以适合iPhone 3.5英寸和4英寸有关。如果您查看下面的屏幕截图,您可能会得到我要解决的大多数问题。
因此,我们的设计师设计了布局,从中您可以看到,彩色按钮应该填充两个iphone设备组的屏幕高度,减去该应用程序的stautus栏和导航栏的高度。
I've had a look around a liitle bit about auto-resize, however I don't feel it is suitable for the requirements as you can see in the image.
Another approach that I thought about was in code, I would write an if statement, to determine if the person using the app was on the iphone 4 inch then load different images. However upon thinking about it more detail I would have to change the position for each of those buttons to ensure that the newly loaded images to prevent overlapping.
My question would be is there a way to change the position of the buttons in objective c to achieve what I want according to the screenshots?
Also it would be greatly appreciated if you can tell me if I am on the right track on the approach of my current problem.
Thanks heaps.
如果您不想使用AutoLayout,那么我建议您在Interface Builder中将其关闭,以便您可以手动控制框架。至于控制框架,请确保您要编辑的每个视图都可被您的代码访问(它的anIBOutlet
或您手动实例化它),然后调整myView.frame
属性。myView.frame
是CGRect
,因此您可以像这样编辑它:myView.frame = CGRectMake(x, y, width, height)
。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句