Images of UITableView Cells change?

↘锁芯ラ 提交于 2019-12-10 17:44:22

问题


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,

Regards,


回答1:


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:


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

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

Hope that helps.




回答2:


- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return 120; // also custom uitableviewcell should have same height
}


来源:https://stackoverflow.com/questions/9328122/images-of-uitableview-cells-change

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!