无法使视图等宽细胞iOS中? [英] Unable to make view equal width to cell in iOS?

查看:109
本文介绍了无法使视图等宽细胞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 that targetRuntime="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 to targetRuntime="iOS.CocoaTouch.iPad" and then just check preview...and you can see that it works fine....

这篇关于无法使视图等宽细胞iOS中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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