草庐IT

constraint1

全部标签

ios - 激活约束 : and deactivateConstraints: not persisting after rotation for constraints created in IB

新的NSLayoutConstraint方法activateConstraints:和deactivateConstraints:似乎无法与IB创建的约束一起正常工作(它们确实可以正常工作对于代码创建的约束)。我用一个按钮创建了一个简单的测试应用程序,该按钮具有两组约束。已安装的一组具有centerX和centerY约束,另一组未安装的具有顶部和左侧约束(常量10)。按钮方法切换这些约束集。这是代码,@interfaceViewController()@property(strong,nonatomic)IBOutletCollection(NSLayoutConstraint)NSA

ios - 'NSInvalidArgumentException',原因 : 'Unable to parse constraint format'

我有一个subview,我想在旋转屏幕期间保持停止,所以我决定放置NSLayoutConstraint类型:到Superview的尾随空格顶层空间到Superview按钮空间到Superview我在UITableViewCell的子类中。我写了代码,但出现以下错误:'NSInvalidArgumentException',reason:'Unabletoparseconstraintformat:selfisnotakeyintheviewsdictionary.H:[self.arrows]-5-|我在CustomCell.m中的代码是:self.arrows=[[Arrowsall

ios - 自动布局 : What creates constraints named UIView-Encapsulated-Layout-Width & Height?

我的布局约束在InterfaceBuilder中很好,但由于框架的某些部分应用了我真正不想要的固定高度和宽度约束,在运行时出现异常。它们为什么在那里,如何关闭它们?它们是记录列表中显示的最后两个约束:2014-04-2609:02:58.687BBCNews[32058:60b]Unabletosimultaneouslysatisfyconstraints.Probablyatleastoneoftheconstraintsinthefollowinglistisoneyoudon'twant.Trythis:(1)lookateachconstraintandtrytofigure

ios - "Unable to simultaneously satisfy constraints"隐藏 View 上的 UIStackView "squished"

当我的UIStackView“行”被压扁时,它们会抛出AutoLayout警告。但是,它们显示正常,除了这些类型的日志之外没有其他错误:Unabletosimultaneouslysatisfyconstraints.Probablyatleastoneoftheconstraintsinthefollowinglistisoneyoudon'twant.Trythis:(1)lookateachconstraintandtrytofigureoutwhichyoudon'texpect;(2)findthecodethataddedtheunwantedconstraintorcon

ios - Xcode 9 - "Fixed Width Constraints May Cause Clipping"和其他本地化警告

我下载了新的Xcode,在InterfaceBuilder中我遇到了很多问题,警告说的是这样的:FixedWidthConstraintsMayCauseClipping看起来像这样:我确实有多种语言的本地化,我理解标签大小可能会在另一种语言中发生变化的警告,但我的应用程序没有这个问题。昨天在Xcode8上跑测试了一下,没问题。我不想花很多时间添加毫无意义的新约束。有什么建议的解决方案吗? 最佳答案 即使我的应用程序中没有多种语言,我也会收到相同的警告,这让我找出了真正发生的事情。..这里发生了一些不同的事情。通过将对象间距的宽度从

flutter - 'constraints.hasBoundedWidth' : is not true

以下是我的代码main()=>runApp(MyApp());classMyAppextendsStatelessWidget{@overrideWidgetbuild(BuildContextcontext){returnMaterialApp(title:"StudentInfo",debugShowCheckedModeBanner:false,home:SafeArea(child:HomePage(),),);}}classHomePageextendsStatelessWidget{@overrideWidgetbuild(BuildContextcontext){retu

python - django.db.utils.IntegrityError : NOT NULL constraint failed: products_product. 图像错误与图像字段

我想将ImageField添加到我的Product模型并将其上传到我的media_cdn目录,但是当我将我的基础迁移到我的model.py它返回以下错误:django.db.utils.IntegrityError:NOTNULLconstraintfailed:products_product.imageERRORWITHIMAGEFIELDcmd的确切输出是:operation.database_forwards(self.app_label,schema_editor,old_state,project_state)File"C:\Users\PANDEMIC\Desktop\t

同时选择和插入时sqlite和 'constraint failed'错误

我正在研究迁移功能。它从旧表中读取数据并将其插入到新表中。所有这些东西都在低优先级的后台线程中工作。我的伪代码步骤。sqlite3_prepare_stmt(selectstatement)sqlite3_prepare_stmt(insertstatement)while(sqlite3_step(selectstatement)==SQLITE_ROW){getdatafromselectrowresultssqlite3_bindselectresultstoinsertstatementsqlite3_step(insertstatement)sqlite3_reset(ins

python - Django makemigrations 有效,迁移失败,显示 "django.db.utils.IntegrityError: NOT NULL constraint failed"

我卡住了。Django1.7,SQLite3。我更改了我的模型以添加thumbnail列,如thistutorial中所示.是这样的:fromdjango.dbimportmodelsclassArticle(models.Model):title=models.CharField(max_length=200)body=models.TextField()pub_date=models.DateTimeField('datepublished')likes=models.IntegerField(default=0)def__str__(self):returnself.title现

ios - heightAnchor.constraint 不起作用(使用 Swift 的 Apple FoodTracker 教程)

我一直在做Apple的iOS教程;开始开发iOS应用程序。https://developer.apple.com/library/content/referencelibrary/GettingStarted/DevelopiOSAppsSwift/ImplementingACustomControl.html#//apple_ref/doc/uid/TP40015214-CH19-SW1在教程中,我在水平堆栈View上添加了一个大小限制为44.0x44.0的按钮。但是,模拟器会显示一个更大的按钮。looksthesizeconstraintsdonotwork.我的代码如下。你能给出