autolayout

dequeueReusableCell breaks cliptobounds

眉间皱痕 提交于 2020-01-11 08:01:31
问题 I've got a very simple UIScrollView with some content (many subviews). This scroll view is used to show some posts made by users (image + text). One of these views is actually the image of the author and it overflows bottom cell bounds. It is thus overlapped with the cell coming after, and using clipToBounds = false I'm able to obtain the desired result. Everything works great if I scroll down. When I start to scroll back up the view that previously was overlying now gets clipped. Cell

Fixed / Float view in UIScrollView with AutoLayout

妖精的绣舞 提交于 2020-01-11 05:13:06
问题 In this technical Note Apple states that you can make a subview of UIScrollView fixed / floating by adding constraints to UISCrollView's superview. I tried that but I'm doing something wrong and I can't figure out whats the problem. Note that you can make a subview of the scroll view appear to float (not scroll) over the other scrolling content by creating constraints between the view and a view outside the scroll view’s subtree, such as the scroll view’s superview. That's what I did. I have

How to use autolayout to scale view for all screen sizes?

喜欢而已 提交于 2020-01-11 03:35:50
问题 The main navigation view of my app uses UIButtons with background images. I'm using autolayout in IB to lay out the view. I want the view to look the same (or similar, just scaled appropriately) on iphone 4, 5, 6, and 6plus. I have tried using vertical and horizontal constraints but have trouble figuring out how to use the aspect ratio constraint. This is what the view looks like on an iphone 5. Here is what I've got so far on an iphone 6 This is what I want it to look like on an iphone 6

Adding autolayout constraints to navigation controller programmatically

心已入冬 提交于 2020-01-10 05:10:26
问题 I am trying to add constraints to a UI label I added on a navigation bar. The UI label shows a running timer Here is my code, self.label = [[UILabel alloc] initWithFrame:CGRectMake(550, 15, 150, 14)]; self.label.text = @"Label"; [self.label setTranslatesAutoresizingMaskIntoConstraints:NO]; [self.navigationController.navigationBar addSubview:self.label]; [self.navigationController.navigationBar addConstraint:[NSLayoutConstraint constraintWithItem:self.label attribute:NSLayoutAttributeTrailing

iOS - Using storyboard and autolayout to center the UIScrollView

时光总嘲笑我的痴心妄想 提交于 2020-01-09 09:55:52
问题 I'm creating iOS app using story board and auto layout so that it will work good on both iPhone4 and iPhone5. Below is the screen shot of the view that I'm creating using story board. In the above image, I want to keep the scroll view in the middle from leading edge of superview and the right table view. I dont want the scroll view to increase its width in iPhone5. I tried different combinations of constraints, but I couldn't achieve it. Can some suggest me what are all constraints that I've

AutoLayout multiline UILabel cutting off some text

烂漫一生 提交于 2020-01-09 06:20:29
问题 I'm trying to learn auto layout, finally thought I was getting the hang on it when this happened. I'm playing about with prototype cells and labels. I'm trying to have a Title, titleLbl - blue box in picture Money, moneyLbl - green box in picture Subtitle / Description, subTitleLbl - red box in picture So far I have this: What I want to achieve is: The green box should always display on 1 line fully The value inside the green box should be centred based on the blue box The blue box will take

iOS AutoLayout - get frame size width

◇◆丶佛笑我妖孽 提交于 2020-01-08 13:57:32
问题 I am developing using iOS 6 auto layout I would like to log a message displaying the frame width of the view. I can see the textView on the screen. But I get the width and height as zero, am I missing something ? NSLog(@"textView = %p", self.textView); NSLog(@"height = %f", self.textView.frame.size.height); NSLog(@"width = %f", self.textView.frame.size.width); textView = 0x882de00 height = 0.000000 width = 0.000000 回答1: I think auto layout hasn't had the time to layout your views by the time

iOS AutoLayout - get frame size width

感情迁移 提交于 2020-01-08 13:56:08
问题 I am developing using iOS 6 auto layout I would like to log a message displaying the frame width of the view. I can see the textView on the screen. But I get the width and height as zero, am I missing something ? NSLog(@"textView = %p", self.textView); NSLog(@"height = %f", self.textView.frame.size.height); NSLog(@"width = %f", self.textView.frame.size.width); textView = 0x882de00 height = 0.000000 width = 0.000000 回答1: I think auto layout hasn't had the time to layout your views by the time

how can I make in auto layout that view1 height will be = 3.7 view2 height?

你说的曾经没有我的故事 提交于 2020-01-07 14:03:18
问题 I have view1 and view2 on screen. how can I make in auto layout that view1 height will be = 3.7 view2 height? Maybe that can be done by adding constraints in code. But I want to know all solutions. Also how It can be done that view1 height will be = 3 view2 height? I think that can be done by adding 2 more views (viewAdditon1, viewAdditon2) . so that view1 ,viewAdditon1, viewAdditon2 will have equal height. also view1.y top = view2.y top. and also viewAdditon1.y bottom = view2.y bottom.

how can I make in auto layout that view1 height will be = 3.7 view2 height?

喜你入骨 提交于 2020-01-07 14:02:47
问题 I have view1 and view2 on screen. how can I make in auto layout that view1 height will be = 3.7 view2 height? Maybe that can be done by adding constraints in code. But I want to know all solutions. Also how It can be done that view1 height will be = 3 view2 height? I think that can be done by adding 2 more views (viewAdditon1, viewAdditon2) . so that view1 ,viewAdditon1, viewAdditon2 will have equal height. also view1.y top = view2.y top. and also viewAdditon1.y bottom = view2.y bottom.