UITableView Cell 的图像发生变化?

发布于 2025-01-06 08:54:59 字数 324 浏览 4 评论 0原文

当我完成了应用程序内购买应用程序的开发后,在 iPad/Iphone 上进行了多次测试后,一切都很好,表格视图单元格的图像及其高度与代码中所写的完全相同,因此我上传了该应用程序,当它出现时被处理到应用程序商店,我下载了它,iPhone/iPad 中的表格视图单元格的尺寸不同,比测试时设置的尺寸大得多,所以单元格中的图像就像拉伸了!!!并且不清晰,我尝试直接通过测试它xcode 到我的设备,它几乎像以前一样好,但问题是只有当从商店下载时,

我真的很感谢任何帮助, 测试图像

问候,

While i finished developing an in-app-purchase application, and after several testing on iPad/Iphone, every thing was fine, the images of table view's cells and its hight was exactly as wrote in code, so i upload the application, when it was processed to the app Store, i download it, the table view cells in both IPhone/IPad were in different sizes much bigger size then that was set while testing,so the image in cells was like stretched!!!!and not clear, i tried to test it then directly via xcode to my device, it was almost fine as before, but the problem is only when downloading from store,

I really appreciate any help,
testing image

after downloading from store

Regards,

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

笑着哭最痛 2025-01-13 08:54:59

这很可能与浮点计算优化有关。

当构建发布时,默认情况下,Xcode 将尝试完全优化您的代码,包括使您的浮点计算更加高效。然而,有时它们可​​能会被错误地优化,这可能会导致重大问题,特别是在视图的定位/大小调整等方面。

对我来说,这种情况发生在构建发布+armv6架构时,我已经有了 之前完全相同的问题(仅在发布时才实现)。

值得庆幸的是,有一种方法可以禁用浮点优化。操作方法如下:

使用 LLVM GCC 4.2

  1. 在左侧文件窗格中单击您的项目
  2. 单击Targets 下的项目名称(如下所示),然后单击“Build Settings” 。
  3. 在右侧的搜索框中搜索“thumb”
  4. 您应该会在“LLVM GCC 4.2 - 代码生成”下看到一个名为“Compile for Thumb”的设置。如果您不这样做,那是因为您使用的是 Apple LLVM 编译器 3.0(相关说明如下)。
  5. 将鼠标悬停在“发布”上,然后单击加号图标。
  6. 应该会出现一个新选项,带有一个下拉列表,从下拉列表中选择“ARMv6”。
  7. 然后为该选项选择“否”。现在它应该如下所示:

Screenshot shown Compile for Thumb setup


Apple LLVM 3.0 编译器

  1. 使用 上述步骤 1 和 2。
  2. 在搜索框中搜索“other c flags”
  3. 按照上述相同步骤添加 ARMv6 + 版本的特定配置。
  4. 双击带有标志的框,然后添加标志 -mno-thumb。现在应该如下所示

Disabling Compiile for Thumb for the Apple Compiler

如果此后在发布版本下仍然存在问题,您可能想尝试全局禁用拇指编译。

希望有帮助。

This is quite likely to be do with floating-point calculation optimization.

When building for release, by default, Xcode will try to fully optimize your code, including making your floating-point calculations more efficient. However, sometimes they can be incorrectly optimized, and this can cause major issues especially with positioning / sizing of views etc.

For me, this happens when building for release + armv6 architecture, and I've had exactly the same problem (only realized when released) before.

Thankfully, there is a way to disable the floating-point optimizations. Here's how:

Using LLVM GCC 4.2

  1. Click on your project in the files pane on the left
  2. Click the project name under Targets (as seen below), then click "Build Settings".
  3. Search for "thumb" in the search box on the right hand side
  4. You should see a setting called "Compile for Thumb" under "LLVM GCC 4.2 - Code Generation". If you don't, it's because you're using the Apple LLVM compiler 3.0 (instructions for that are below).
  5. Hover over Release, and click the plus icon.
  6. A new option should appear, with a drop-down, select "ARMv6" from the dropdown.
  7. Then select "No" for that option. It should now look like below:

Screenshot showing Compile for Thumb setting


Using Apple LLVM 3.0 Compiler

  1. Follow steps 1 and 2 above.
  2. Search for "other c flags" in the search box
  3. Follow the same steps above to add a specific configuration for ARMv6 + release.
  4. Double-click the box with the flags in, and add the flag -mno-thumb. It should now look like below

Disabling Compiile for Thumb for the Apple Compiler

If it still has issues under the release build after that, you may want to try disabling compile for thumb globally.

Hope that helps.

云归处 2025-01-13 08:54:59
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return 120; // also custom uitableviewcell should have same height
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return 120; // also custom uitableviewcell should have same height
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文