【发布时间】:2014-05-07 11:20:06
【问题描述】:
我在 UI 设计中使用了带有自动布局的情节提要。基本上在 android 中会有三个不同的属性,比如 Visible、Invisible 和 Gone。
例如:
1) android:visibility="gone" // used to hide the control and as well as space
(or)
CONTROLNAME.setVisibility(View.GONE);
2) android:visibility="invisible" // used to hide the control but it will take space
(or)
CONTROLNAME.setVisibility(View.INVISIBLE);
在 iOS 中,
objective-c
1) ?
2) [CONTROLNAME setHidden:TRUE]; // used to hide the control but it will take space
迅速
1) ?
2) CONTROLNAME.isHidden = true // used to hide the control but it will take space
作为 iOS 中的 Gone 我已经从谷歌搜索但我无法找到解决方案。
【问题讨论】:
-
我认为没有这样的功能,但你可以用相对视图的自动布局来做到这一点
-
虽然当视图(或控件)被移除时自动布局会帮助您布局其他视图,但自动布局本身并不能帮助您移除视图占用的“空间”。
-
看看@nevin chen 的解决方案,我认为这是您的案例的完美解决方案
-
实现这一点的唯一方法是在界面构建器中使用“堆叠视图”
标签: android ios objective-c swift autolayout