无法使视图等宽细胞iOS中? [英] Unable to make view equal width to cell in iOS?
问题描述
我在做一个iOS.I自定义单元格添加原型cell.I米试图宽度相等的细胞内添加视图于母公司cell.But单元格的宽度不相等,请告诉我,我应该怎么办呢?
约束是:
查看结构为:
编辑:
在iPad上preVIEW没有显示完整视图
。但在实际设备上它的工作原理fine.Why?
样品这里
https://drive.google.com/file/ D / 0B7RGQm8-8k24Q0tXUFZOLUZFQk0 /看法?USP =共享
块引用>解决方案当我检查了您的样本项目,我发现你做你的viewController大小
iPhone4.7寸
。 ..和我查分镜源$ C $ c和我发现,targetRuntime =iOS.CocoaTouch
所以,在preVIEW的时候,它只是复制了preVIEW参考基本上是iPhone的尺寸和显示你的iPhone大小preVIEW ...
有关解决我是什么...只是故事板源$ C $ c修改。
搜索
targetRuntime =iOS.CocoaTouch
并将其更改为targetRuntime =iOS.CocoaTouch.iPad
然后只检查preVIEW ...你可以看到,它工作得很好....I am making a custom cell in iOS.I have added prototype cell.I m trying to add a view inside a cell of equal width to parent cell.But the width of cell is not equal please tell me how should i do it?
Constraints are:
View structure:
EDIT:
In preview on iPad it does not show complete view .But on actual device it works fine.Why?
sample here
https://drive.google.com/file/d/0B7RGQm8-8k24Q0tXUFZOLUZFQk0/view?usp=sharing
解决方案As I checked your sample project I found that You made your viewController size to
iPhone4.7 inch
...and I checked the source code of storyboard and I found thattargetRuntime="iOS.CocoaTouch"
So, at the time of preview,it just copied the reference for preview which is basically iPhone size and display you the iPhone size preview...
For the solution what I do is...just change in Storyboard source code..
Search for
targetRuntime="iOS.CocoaTouch"
and change it totargetRuntime="iOS.CocoaTouch.iPad"
and then just check preview...and you can see that it works fine....这篇关于无法使视图等宽细胞iOS中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!