布局中的奇怪异常 [英] Strange exception in layouts

查看:110
本文介绍了布局中的奇怪异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试调用此方法:

avatarIconImageView.setContentHuggingPriority(UILayoutPriorityDefaultLow, forAxis: UILayoutConstraintAxis.Horizontal)

并捕获此异常:

架构armv7的未定义符号:
"_UILayoutPriorityDefaultLow",引用自: __TFC13TCProject_iOS36TCAvatarWithCounterUniversalCellView22configureBodyCellViewsfS0_FT_T_ 在TCAvatarUniversalCellView.o ld中:未找到符号 体系结构armv7 clang:错误:链接器命令失败,并带有退出代码 1(使用-v查看调用)

Undefined symbols for architecture armv7:
"_UILayoutPriorityDefaultLow", referenced from: __TFC13TCProject_iOS36TCAvatarWithCounterUniversalCellView22configureBodyCellViewsfS0_FT_T_ in TCAvatarUniversalCellView.o ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation)

什么意思?

推荐答案

这看起来像是iOS 8 SDK中的错误.您可以通过传入原始值来解决此问题.

This looks like a bug in the iOS 8 SDK. You can work around this by just passing in a raw value.

  • UILayoutPriorityDefaultRequired = 1000
  • UILayoutPriorityDefaultHigh = 750
  • UILayoutPriorityDefaultLow = 250

以您的情况

avatarIconImageView.setContentHuggingPriority(250, forAxis: UILayoutConstraintAxis.Horizontal)

这篇关于布局中的奇怪异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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