简体   繁体   English

视图宽度不等于单元格宽度不可用?

[英]View width is not equal to cell width inseide uitable?

I am trying to add a view inside a UITableCell.It works fine for all the devices but on iPad the width of view is not equal to cell width.The width of view is half of the width of cell.Please tell me what do here.我正在尝试在 UITableCell 中添加一个视图。它适用于所有设备,但在 iPad 上,视图宽度不等于单元格宽度。视图宽度是单元格宽度的一半。请告诉我在这里做什么. 在此处输入图片说明

Constraints are:约束条件是:

在此处输入图片说明

please select width and height (any,any) in storyboard.It may be helpful to you.请在故事板中选择宽度和高度(任何,任何)。它可能对您有所帮助。 在此处输入图片说明

You Can use constrain你可以使用约束

First select view which you put on cell and give constrain from 4 side首先选择您放在单元格上的视图并从 4 边给出约束

like below in image如下图所示

give it top,bottom,left,right = 0给它上、下、左、右 = 0

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM