草庐IT

layout_align_parent_right

全部标签

ios - "Auto Layout still required..."返回主视图 Controller 时崩溃

我的应用启动时带有一个主菜单,该菜单是UIViewController的自定义子类,名为LVSMainViewController。它嵌入在UINavigationController中,在Storyboard中设置为初始VC。LVSMainViewController实现了-viewDidLayoutSubviews。点击按钮会将用户带到应用程序的不同部分(不同的VC)。用户通过连接到推送segue的按钮返回到主菜单。但是当应用程序再次加载主菜单VC时,它会崩溃并显示以下消息:2014-08-2816:11:14.122*Assertionfailurein-[UIViewlayou

android - 如何在自定义 ViewGroup 中正确扩展 XML-Layout-File?

我想在自定义ViewGroup类中扩展XML-Layout-File,我的问题是它只产生一个空屏幕。在Activity类中做同样的工作很好。这是我的简单XML布局文件:shownumberlayout.xml:这是工作版本,在ActivityShowNumber中膨胀shownumberlayout.xml:ShowNumber.classpublicclassShowNumberextendsActivity{/**Calledwhentheactivityisfirstcreated.*/@OverridepublicvoidonCreate(BundlesavedInstance

android - 如何在自定义 ViewGroup 中正确扩展 XML-Layout-File?

我想在自定义ViewGroup类中扩展XML-Layout-File,我的问题是它只产生一个空屏幕。在Activity类中做同样的工作很好。这是我的简单XML布局文件:shownumberlayout.xml:这是工作版本,在ActivityShowNumber中膨胀shownumberlayout.xml:ShowNumber.classpublicclassShowNumberextendsActivity{/**Calledwhentheactivityisfirstcreated.*/@OverridepublicvoidonCreate(BundlesavedInstance

ios - Auto Layout = ViewWillAppear 的 View 宽度错误

我正在为我的部分用户界面使用自动布局。当我在viewWillAppear中检查View的宽度时,宽度尚未更新。它在第二次回调到-(void)updateViewConstraints后得到更新。问题是我根据viewWillAppear中的这个宽度设置了我的UI部分(出于遗留原因使用spring和struts)。什么时候是设置这个接受宽度参数的旧版UI的好时机?谢谢 最佳答案 布局发生在viewWillAppear返回之后。在viewDidLayoutSubviews(在您的ViewController中)或在layoutSubvie

ios - 使用 iOS Auto Layout 在 subview Controller 和它的父 View 之间建立约束

在我的RootViewController中,我添加了一个subviewController的View作为subview,如下所示:ChildViewController*cvc=[[ChildViewControlleralloc]init];[selfaddChildViewController:cvc];[self.viewaddSubview:cvc.view];[cvcdidMoveToParentViewController:self];我现在想使用NSLayoutConstraint将cvc.view定位在父View(self.view)中,这样cvc.view就会定位在

ios - 核心数据 : Parent context and change propagation

我的应用程序中有以下核心数据设置:PersistentStoreCoordinator^BackgroundMOC(NSPrivateQueueConcurrencyType)^MainQueueMOC(NSMainQueueConcurrencyType)初始化代码如下:_backgroundContext=[[NSManagedObjectContextalloc]initWithConcurrencyType:NSPrivateQueueConcurrencyType];[_backgroundContextsetPersistentStoreCoordinator:self.c

android - 如何在 iOS 中进行 match_parent

我习惯于在我做的地方使用Android背景:android_layout_width="match_parent"orandroid_layout_height="match_parent"如何使用xib在iOS上完成此行为? 最佳答案 1)设置匹配父View边界的subview框架。2)启用自动调整掩码,如屏幕截图所示。 关于android-如何在iOS中进行match_parent,我们在StackOverflow上找到一个类似的问题: https://s

ios - 错误 : Fatal: Not a git repository (or any of the parent directories): . git

当我尝试将图像放入项目的Resources文件夹时,我收到了这条消息:fatal:Notagitrepository(oranyoftheparentdirectories):.git我该如何解决? 最佳答案 遇到了同样的问题。我复制了一个项目,然后尝试删除文件。如果您希望能够编辑项目,请在终端中键入gitinitfolder。这将重新初始化您文件夹中的git。 关于ios-错误:Fatal:Notagitrepository(oranyoftheparentdirectories):.

iphone - 什么时候轮换更改 UICollectionView 的 Layout 参数合适

希望是一个相对较新的UIKit控件的简单问题我有一个UICollectionView,它有一个viewLayout,单行单元格是纵向模式下UICollectionView边界的确切高度因此,当iPad翻转到横向模式时,该行变得比屏幕本高度,此时布局(几乎)悄无声息地失败并提示该行比边界高。操作viewLayout特性的理想方式是什么,特别是当它与响应ViewController中的旋转有关时? 最佳答案 我正在处理类似的问题。目前,我的UICollectionViewController有两个UICollectionViewFlow

ios - 应该显式调用 willMoveToParentViewController :(UIViewController *)parent & didMoveToParentViewController:(UIViewController *)parent?

在WWDC2012session中标题为iOS上ViewController的演变-(void)willMoveToParentViewController:(UIViewController*)parent和-(void)didMoveToParentViewController:(UIViewController*)parent已被提及用于View转换的自定义容器实现。如果我没记错的话,似乎需要在-(void)removeFromSuperview之前或-(void)之后EXPLICITLY调用这些方法addSubview:(UIView*)view但是,当我将它们记录在子类实现中