草庐IT

constraint-layout

全部标签

旋转后如何恢复我在坐标layout中的位置?

当我滚动到嵌套的CrollView的底部并旋转设备时,我在列表中的位置保存了,但是当我旋转回到肖像模式时,AppBarlayout中的ImageView会扩展而不是像我最初旋转屏幕时那样折叠。我想在旋转之前返回到它的状态,图像部分折叠或完全崩溃。设备旋转之前设备旋转后XML文件:看答案添加configchangesparam到清单文件,它对我有用,

ios - "Unable to simultaneously satisfy constraints"当自动布局被禁用时

我在特定View的界面生成器中禁用了自动布局:但是当我为xib文件加载ViewController时,我在控制台中收到此错误:Unabletosimultaneouslysatisfyconstraints.Probablyatleastoneoftheconstraintsinthefollowinglistisoneyoudon'twant.Trythis:(1)lookateachconstraintandtrytofigureoutwhichyoudon'texpect;(2)findthecodethataddedtheunwantedconstraintorconstrai

ios - 在 cellForRowAtIndexPath 中更改 NSLayoutConstraint 常量不断导致 "unable to satisfy constraints"错误

我的应用程序中有很多这样的单元格。有些self调整大小,有些则没有。例如,假设我们有一个自定义的UITableViewCell。100高度。在它的内容View中,我们拖动了2个UIView。UIViewTop和UIViewBottom。每个50高。UIViewTop我们放在内容View的顶部,并给它Leading/Trailing/Top/Height约束。UIViewBottom我们放在内容View的底部,并给它Leading/Trailing/Bottom/Height约束。我们还在UIViewTop和UIViewBottom之间提供VerticalSpacing约束。现在,有时我

ios - 仅在 iOS 7 上向 UITableView 添加 subview 时出现 "Auto Layout still required"错误

我有一个加载UITableViewController的容器。一开始表中没有数据,所以我显示一个空View。这就是我在ViewDidLoad中的做法:emptyView=newUIView();emptyView.BackgroundColor=UIColor.Gray;//worksoniOS8buthastoberemovedoniOS7emptyView.TranslatesAutoresizingMaskIntoConstraints=false;varviews=NSDictionary.FromObjectsAndKeys(newobject[]{emptyView},ne

ios - IB Designables : Failed to render and update auto layout status (Google Maps)

几天来,我遇到了以下问题:Main.storyboard:error:IBDesignables:FailedtorenderandupdateautolayoutstatusforSomeViewController(BeW-27-X9H):dlopen(GoogleMaps.framework,1):nosuitableimagefound.Didfind:GoogleMaps.framework:mach-o,butwrongfiletype我在不同的ViewController中有28个这样的错误,尽管我只在其中几个中使用了Googlemap。由于这个问题,我无法编辑一些Vie

ios - UIPageViewController 和 AutoLayout : constraints are not applied correctly

我以编程方式创建一个UIPageViewController并将其作为子项添加到我的容器ViewController中,如下所示:overridefuncviewDidLoad(){super.viewDidLoad()self.pageViewController=UIPageViewController(transitionStyle:.PageCurl,navigationOrientation:.Horizontal,options:nil)self.mainImageView!.userInteractionEnabled=trueself.pageViewControlle

ios - 使用Auto Layout时相当于 "CGAffineTransformMakeTranslation (0,0)"?动画回到原来的位置

我正在尝试为从位置A到B然后再返回的View设置动画。以前,我会做类似下面的事情来为B设置动画:[UIViewanimateWithDuration:1animations:^{self.myView.transform=CGAffineTransformMakeTranslation(100,0);}];然后动画回到A:[UIViewanimateWithDuration:1animations:^{self.myView.transform=CGAffineTransformMakeTranslation(0,0);}];所有这些都不需要知道原始位置。现在在自动布局中,我使用以下代

ios - Designables : Failed to render and update auto layout status. 我正在使用 Xcode 9.3

我正在使用Xcode9并使用Cocoa框架抛出此错误。我已经尝试了所有可能的方法,但无法解决它。 最佳答案 因此,如果label是pod中的一个库,则您可能受到了cocoapods错误的影响;尝试在您的podfile中添加此post_installpost_installdo|installer|installer.pods_project.build_configurations.eachdo|config|config.build_settings.delete('CODE_SIGNING_ALLOWED')config.bui

后端校验失效-关于javax.validation.Valid,javax.validation.constraints.NotBlank; @NotBlank 注解不生效产生的问题及解决

springboot2.3.2.RELEASE后@NotBlank会失效,2.3.2.RELEASE之前正常使用。1.@notBlank注解我引入的包是jakarta.validationjakarta.validation-api2.0.1其实springboot包含了jakarta.validation等依赖,我springboot包含的原依赖是2.0.2版本,查看maven官网jakarta.validation的依赖也没几个。所以只要springboot中包含了这个包不引入也是ok的。2.重点来了!!!,springboot2.3.2.RELEASE后@NotBlank失效 我们需要手

Symfony2 : phpinfo() using a twig template for layout?

Twig不会处理PHP标签。因此,创建基于布局(例如base.html.twig)的phpinfo()页面是一项挑战。是否可以将phpinfo()的HTML内容转储到某个变量中并将其作为正文内容传递给布局?或者,是否有更好的方法进行? 最佳答案 只需使用输出缓冲捕获phpinfo()的输出,并将其传递给模板。ob_start();phpinfo();$phpinfo=ob_get_clean();echo$twig->render('phpinfo.html.twig',array('phpinfo'=>$phpinfo));