简体   繁体   English

iOS >>自动布局>> iPhone 4与iPhone 5 >>设置多个对象以更改大小

[英]iOS >> Auto Layouts >> iPhone 4 vs. iPhone 5 >> Setting Several Objects to Change Size

I have a screen with the following design: 我的屏幕设计如下:

在此处输入图片说明

在此处输入图片说明

I want to use the same scene for both iPhone4 and iPhone5 screens; 我想在iPhone4和iPhone5屏幕上使用相同的场景; I wish to try and perform it with Auto Layouts. 我希望尝试通过自动版式进行操作。

The image above is the settings for the iPhone5 design. 上图是iPhone5设计的设置。

Most of the constraints are quite simple and clear. 大多数约束非常简单明了。

I have one issue that I'm not so clear how to resolve: I wish that upon 'Auto Layouting' to iPhone4, the following Objects will change as follow: 我有一个问题,我不清楚如何解决:我希望在对iPhone4进行“自动布局”后,以下对象将发生如下变化:

  • The Table View will reduce its Height in 40 (half the reduction required). 表格视图会将其高度减少40(所需的减少一半)。
  • Both Image Views will reduce their Height in 40 (half the reduction required). 两个图像视图都将其高度减少40(所需的减少一半)。

Is there a way to create a set of constraints that will achieve that? 有没有一种方法可以创建一组约束来实现这一目标? ie instructing these 3 Objects to have 2 different heights - one per each screen size - while maintaing the other constraints? 即指示这3个对象具有2个不同的高度-每个屏幕尺寸一个-同时保持其他约束?

First check the screen size Look at this question 首先检查屏幕尺寸看看这个问题

Then update TableView and ImageView's height constraint constants to what you want. 然后将TableView和ImageView的高度约束常数更新为所需的值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM