autolayout

UICollectionView Cell + UiLabel with AutoLayout

与世无争的帅哥 提交于 2019-12-18 11:48:48
问题 I'm trying to pin an UILabel to it's parent cell. I added four constraints (top, leading, trailing, bottom) which works fine on iOS 8.0 but not on iOS 7.X . Please see image below: [Click here for full size] What am I doing wrong? Please advise! EDIT #1 It seems it's only broken since Xcode 6 GM. My approach was working fine in Xcode 6 beta 7. Moreover, if I decrease the inner view's width, it throws the following warning: 2014-09-10 19:58:28.109 Test[57827:60b] Unable to simultaneously

iOS Container View doesn't honour intrinsicContentSize

这一生的挚爱 提交于 2019-12-18 11:20:06
问题 I want to use a Container View to contain a camera preview. I want the camera to centered in the middle and maintain it's proper aspect ratio. (it's pink to make it obvious where its frame is) I'm stuck on the first step of trying to get the camera preview to appear at a size that's smaller than the container. I have a UIView subclass for the Camera Controller's view, and have the code: - (CGSize)intrinsicContentSize { return CGSizeMake(320, 240); } Unfortunately this isn't honoured: From

Resize UITableView Header AND containing UITextView (iOS7 + AutoLayout)

若如初见. 提交于 2019-12-18 10:56:31
问题 I've been struggling with this now for a little while, and I want to make sure I'm doing this the right way. For reference, I am using AutoLayout with Storyboards, and it's an iOS7-only app. I have a UITableView with a header-view, and the UI for the HeaderView is hooked up in the storyboard. I've left the header in the storyboard, and it contains a few elements, one of which is a non-scrollable UITextView. Here is a screenshot of how it basically looks in the storyboard: I darkened the

Autolayout and subviews

戏子无情 提交于 2019-12-18 10:41:07
问题 I am using the iAd suite with storyboards from Apple, as per this link... Apple iAd Storyboard documentation It all works fine until I turn autolayout on. It builds fine but crashes on running. The output I get is: 2013-08-24 12:06:36.138 TabbedBanner[7272:c07] * Assertion failure in -[UIView layoutSublayersOfLayer:], /SourceCache/UIKit_Sim/UIKit-2380.17/UIView.m:5781 2013-08-24 12:06:36.139 TabbedBanner[7272:c07] * Terminating app due to uncaught exception 'NSInternalInconsistencyException',

how can I use one storyboard for 4“ and 3.5” iphone screens with autolayout (ios6 + ios7)?

喜欢而已 提交于 2019-12-18 10:20:25
问题 While there are many questions and answers about building a storyboard layout that would work both on 4" and 3.5" screen sizes, I couldn't find a suitable solution for the following scenario. I use autolayout with ios6 (and ios7), and I don't have to support landscpae or ipad. I have a UIView with several subviews, which have to look as the mockup below. It is easy to set up autolayout constraints in the storyboard to fit either of the screen sizes. My question is - how do I make autolayout

Resize UITableViewCell containing UITextView upon typing

↘锁芯ラ 提交于 2019-12-18 10:17:19
问题 I have an UITableViewController that contains a custom cell. Each cell was created using a nib and contains a single non-scrollable UITextView. I have added constraints inside each cell so that the cell adapts its height to the content of the UITextView. So initially my controller looks like this : Now I want that when the user types something in a cell its content automatically adapts. This question has been asked many times, see in particular this or the second answer here. I have thus

Vertically align text within a UILabel (Note : Using AutoLayout)

跟風遠走 提交于 2019-12-18 10:06:18
问题 I am Copying the same Question asked Before Question. I have tried the solutions given and was not able to solve it since sizetofit was not effective when I use Autolayout. The expected display is like below. 回答1: Edit In my original answer I was using the paragraph style of the label. Turns out that for multi-line labels this actually prevents the label from being multi-line. As a result I removed it from the calculation. See more about this in Github For those of you more comfortable with

What is the difference between all these Auto Layout update methods? Are all necessary?

陌路散爱 提交于 2019-12-18 09:56:58
问题 In the code below, these four methods are called for layout reasoning. I'm a little confused why all of them are needed, though, and what they do differently from one another. They're used in the process to make a cell's height be dynamic with Auto Layout. (Taken from this repository from this question.) [cell setNeedsUpdateConstraints]; [cell updateConstraintsIfNeeded]; [cell.contentView setNeedsLayout]; [cell.contentView layoutIfNeeded]; And it's from this block of code for the cell's

iOS: autolayout for multiple button

纵然是瞬间 提交于 2019-12-18 07:21:22
问题 In my app I have a view for 4 inch screens in this way: And then I want to reduce the size of my buttons when the app is running on an iPhone with a 3.5 inch screen, so I set my layout in this way: but finally I obtain a view in this way In this way the size of my button are ok but they are not aligned, so in this situation, what's the way to have aligned buttons? thanks 回答1: Hi as per your question i've created demo similar to the layout for which you need the controls need to set. I've

Unable to make view equal width to cell in iOS?

大城市里の小女人 提交于 2019-12-18 07:04:09
问题 I am making a custom cell in iOS.I have added prototype cell.I m trying to add a view inside a cell of equal width to parent cell.But the width of cell is not equal please tell me how should i do it? Constraints are: View structure: EDIT: In preview on iPad it does not show complete view .But on actual device it works fine.Why? sample here https://drive.google.com/file/d/0B7RGQm8-8k24Q0tXUFZOLUZFQk0/view?usp=sharing 回答1: As I checked your sample project I found that You made your