Tag: autoresizingmask

xcode / iOS:Autoresize填充视图 – 显式帧大小是必不可less的?

我想要一个UITextView来填充它的superView ,这是一个UIViewController实例内的普通UIView 。 看来,我不能让UITextView完全通过使用autoresizingMask和autoresizesSubviews的API指定的属性。 设置这些在这里显示没有什么; 即使它的superView填充屏幕, UITextView仍然很小。 // use existing instantiated view inside view controller; // ensure autosizing enabled self.view.autoresizesSubviews = YES; self.view.autoresizingMask = UIViewAutoresizingFlexibleHeight| UIViewAutoresizingFlexibleWidth; // create textview textView = [[[UITextView alloc] autorelease] initWithFrame:CGRectMake(0, 0, 1, 1)]; // enable textview autoresizing [textView setAutoresizingMask:UIViewAutoresizingFlexibleWidth| UIViewAutoresizingFlexibleHeight]; // add textview to view [self.view addSubview:textView]; 但是,如果我在视图控制器中实例化我自己的视图,replace它的'.view'属性,那么一切都按预期工作,textView填充它的超级视图: // reinstantiate […]

以编程方式设置UIView的autoresizing掩码?

我必须为UIView以编程方式设置autoresizingMask。 我不知道如何实现这一点。

无法同时满足约束 – 没有约束

我已经通过并删除了每一个用户的约束,但我仍然只是在我旋转设备后得到以下错误。 我绝对不知道为什么。 有没有人有任何想法? 2013-01-14 21:30:31.363 myApp[35869:c07] Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and […]

UIView autoresizingMask – 接口生成器到代码 – 编程创buildstruts和弹簧 – Swift或Objective-C

我已经介绍了一些与Interface Builder的子视图,但是我想用代码来完成。 我读过有关设置view.autoresizingMask属性的UIView文档 。 我正在寻找一个合理的解释,如何通过使用提供的各种口罩(如UIViewAutoresizingFlexibleLeftMargin等)来翻译struts和弹簧。

以编程方式与Interface Builder / xib / nib进行自动调整屏蔽

我在一个(可能是错误的)假设,使xib中的右边距指示符相当于使用内部代码中的UIViewAutoresizingFlexibleLeftMargin等。 所以,我曾经根据这个快照思考: 今天晚些时候,我不得不交叉检查,并偶然发现这个线程 。 另外还有苹果文档,标题为“使用自动修复规则自动处理版面布局”部分,链接如下: https : //developer.apple.com/library/content/documentation/WindowsViews/Conceptual/ViewPG_iPhoneOS/CreatingViews/ CreatingViews.html 所以我现在有一个更新的概念,就如何以编程方式设置自动调整屏蔽等同于xib设置: scheme1 :仅设置(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)相当于: 在XIB? 场景2 :在代码中设置(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin)相当于: 在XIB? 我的2更新情况是否正确? 我现在在我的理解?