如何在XCode 7的情节提要中将视图高度设置为屏幕高度的百分比 [英] How to set View height as percentage of the screen height in Storyboards with XCode 7

查看:112
本文介绍了如何在XCode 7的情节提要中将视图高度设置为屏幕高度的百分比的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要设计如下图所示的视图,并且尝试了固定高度,还尝试了紧凑宽度和常规高度以及常规宽度和紧凑高度,但是这些方案对我而言不起作用.

I need to design the view like below image and I have tried with fixed heights and also tried compact width and regular height and regular width and compact height but those scenarios did not worked for me.

如何在故事板"中将视图高度"设置为屏幕高度的百分比?

How can i set View height as percentage of the screen height in Storyboards?

我正在使用Xcode 7

I'm using Xcode 7

推荐答案

基本上,您需要对高度相等约束的multiplier属性进行操作.为此,请在按住CTRL键的同时从视图拖动到其父视图并选择equal heights constraint,然后在大小检查器中通过将其设置为multiplier来编辑此约束.所需的值也可以表示为1:25、1/25、0.025 .如果相反,则只需反转图片中的项目即可.

Basically you need to act on the multiplier property of an height equal constraint. To do that while pressing CTRL, drag from the view to its superview and select equal heights constraint, later edit this constraint in Size Inspector by setting its multiplier the desired value can be expressed also as 1:25, 1/25, 0,025. If it working on the contrary just reverse items as in the picture.

这篇关于如何在XCode 7的情节提要中将视图高度设置为屏幕高度的百分比的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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