无法在 iOS 中使视图与单元格宽度相等?

2023-09-10移动开发问题
2

本文介绍了无法在 iOS 中使视图与单元格宽度相等?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我正在 iOS 中制作一个自定义单元格.我添加了原型单元格.我正在尝试在与父单元格宽度相等的单元格内添加一个视图.但是单元格的宽度不相等请告诉我我该怎么做是吗?

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?

约束是:

视图结构:

在 iPad 上预览时不显示完整视图.但在实际设备上它工作正常.为什么?

In preview on iPad it does not show complete view .But on actual device it works fine.Why?

此处示例

https://drive.google.com/file/d/0B7RGQm8-8k24Q0tXUFZOLUZFQk0/view?usp=sharing

推荐答案

当我检查您的示例项目时,我发现您将 viewController 大小设置为 iPhone4.7 英寸...我检查了故事板的源代码,我发现 targetRuntime="iOS.CocoaTouch"

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"

所以,在预览的时候,它只是复制了预览的参考,基本上是 iPhone 尺寸,并显示给你 iPhone 尺寸预览......

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...

对于解决方案,我所做的是...只需更改 Storyboard 源代码..

For the solution what I do is...just change in Storyboard source code..

搜索 targetRuntime="iOS.CocoaTouch" 并将其更改为 targetRuntime="iOS.CocoaTouch.iPad" 然后只需检查预览......你可以看看它工作正常....

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 中使视图与单元格宽度相等?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

硬件音量按钮更改应用程序音量
Hardware Volume buttons change in app volume(硬件音量按钮更改应用程序音量)...
2024-08-12 移动开发问题
10

Cocos2d - 如何检查不同层中对象之间的交集
Cocos2d - How to check for Intersection between objects in different layers(Cocos2d - 如何检查不同层中对象之间的交集)...
2024-08-12 移动开发问题
8

恢复游戏 cocos2d
Resume game cocos2d(恢复游戏 cocos2d)...
2024-08-12 移动开发问题
6

Cocos2D + 仅禁用 Retina iPad 图形
Cocos2D + Disabling only Retina iPad Graphics(Cocos2D + 仅禁用 Retina iPad 图形)...
2024-08-12 移动开发问题
10

如何将 32 位 PNG 转换为 RGB565?
How to convert 32 bit PNG to RGB565?(如何将 32 位 PNG 转换为 RGB565?)...
2024-08-12 移动开发问题
21

正确的 cocos2d 场景重启?
Proper cocos2d scene restart?(正确的 cocos2d 场景重启?)...
2024-08-12 移动开发问题
7