作者kiii210 (JohnnyChian)
看板MacDev
标题[问题] Autolayout使用问题
时间Mon Feb 10 13:44:06 2014
大家好,上来请教一下各位高手...小弟在Autolayout使用上一直都很有困难
现在是用StoryBoard拉Autolayout
画面上有一个 "searchBar" 跟 "tableView" 排列方式如图
http://i.imgur.com/RrlzpSr.png
searchBar的constraint是Bottom Space to tableView, 距离0
tableView的constraint是Top Space to tableView, 距离0
另外也有Leading space 跟 Trailing Space to Superview, 距离也都是0
现在有个需求, 有某个状况会要把searchBar从画面中移除(removeFromSuperView)
而我想要在searchBar移除之後让tableView的Top Space to Superview 是 0
简单的说就是searchBar移除之後, tableView要往上递补..
不过一直试不出来, 也不知道constraint怎麽设比较好
不知道searchBar移除之後, 该怎麽让autolayout知道我想重新layout @@
麻烦一下各位高手了 谢谢
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 118.169.113.45