autolayout

Adjust width of UITextField to fill toolbar in landscape

爱⌒轻易说出口 提交于 2020-01-02 03:40:27
问题 In a UIToolbar , I have added a UITextField to the middle of the bar (which gets added as a UIBarButtonItem ) with another UIBarButtonItem (Action button) next to it. I added flexible space bar button items at the very left and very right. It looks great on portrait, but when I rotate to landscape it centers them and looks ok, but I need the text field to get stretched to fill the width and push the last button clear to the right - exactly like it does in Messages - on iPhone and iPad. I

How to resize two subviews based on priorities using Cocoa Autolayout?

放肆的年华 提交于 2020-01-02 02:56:09
问题 I am playing with Autolayout in Cocoa and some things are not clear for me. I have 2 views on a window. The width of each view is 1/2 width of the parent window. | | | | | | | View1 | View2 | | | | | | | If I resize a window I want the View2 to resize first. | | | | | | | View1 |View2| | | | | | | When View2 reaches its minimal size I want View1 to be resized to its minimal size. | | | | | | |View1|View2| | | | | | | How can I do that? 回答1: The layout seems a bit unspecified. When does view2

How to set View height as percentage of the screen height in Storyboards with XCode 7

怎甘沉沦 提交于 2020-01-02 02:31:08
问题 I need to design the view like below image and I have tried with fixed heights and also tried compact width and regular height and regular width and compact height but those scenarios did not worked for me. How can i set View height as percentage of the screen height in Storyboards? I'm using Xcode 7 回答1: Basically you need to act on the multiplier property of an height equal constraint. To do that while pressing CTRL, drag from the view to its superview and select equal heights constraint ,

Disable Constraints in Xcode Storyboard

旧街凉风 提交于 2020-01-02 02:19:04
问题 I'm trying to layout a very simple view. I've placed 4 custom buttons in the view in a grid like spacing. But when I run the app I get two of the buttons with different sizes. I've included the storyboard and simulator images here. I would LOVE to disable constraints but cant find where to do it! I really don't want them. This is just for a simple prototype app and in the end I won't even have these buttons, I'll lay everything out in code. I've tried dragging in 4 individual buttons AND

How to make UITableViewCell display fullscreen (allow paging)?

岁酱吖の 提交于 2020-01-01 19:39:51
问题 I have a custom UITableView - Scroll, Paging Enable . Because each of my cell has one background image, I want each time I scroll up or down it will display each image as full screen. I try to make my UITableViewCell to be full screen (stretch its height as big as the tableview). However, I've got a problem: when I scroll(paging), the cell doesn't display as full screen. It contains a small part of the next cell. Then the part of next cell increase bigger and bigger each time I scroll(paging)

WKWebView LayoutConstraints issue

China☆狼群 提交于 2020-01-01 19:31:48
问题 I have created a simple webview app. But there is a small problem and I can not fix it. It loads the first page without issue. When I click to the first input, the program crashes and the error code is below: 2017-10-28 23:50:54.289690+0400 BFI Schools[68425:3885613] [LayoutConstraints] 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

Floating autolayout iOS/OSX

两盒软妹~` 提交于 2020-01-01 15:09:53
问题 I have a need for floating autolayout. I find that its quite hard problem to solve but i think it can be done by using some of the tips described here: http://www.objc.io/issue-3/advanced-auto-layout-toolbox.html Maybe someone have already tried solving such problem or would like to try it. So here is the challenge: nicely floated views which drops to new line if content width exceeded, like in next picture view1 width is bigger so view2 drops to new line. (same would happen if view2 width

Floating autolayout iOS/OSX

99封情书 提交于 2020-01-01 15:09:13
问题 I have a need for floating autolayout. I find that its quite hard problem to solve but i think it can be done by using some of the tips described here: http://www.objc.io/issue-3/advanced-auto-layout-toolbox.html Maybe someone have already tried solving such problem or would like to try it. So here is the challenge: nicely floated views which drops to new line if content width exceeded, like in next picture view1 width is bigger so view2 drops to new line. (same would happen if view2 width

iOS 8 AutoLayout scrollview scrolls horizontally on iPhone 6 plus

大兔子大兔子 提交于 2020-01-01 11:39:14
问题 I do have an App for iOS and while adapting all the UI to auto layout an size classes to support the new iPhone 6 and iPhone 6 plus i faced a weird issue... al my scrolls view work fine in iPhone 4s, 5, 5s and 6... in iPhone 6 plus they are not scrolling only vertically but also horizontally... like if the content size of the scroll view where a couple of pixel wider than the view itself (so it move horizontally of a couple of pixel and then it bounce). I do not understand why is this

Behavior changes for updateViewConstraints in iOS 8

喜你入骨 提交于 2020-01-01 10:41:28
问题 I notice some small graphical glitches while testing one of my app under iOS 8: some UIViews elements are not in the right place, others have not the right size. In a first step, I use storyboard, Auto-Layout and constraints. Then I programmatically tune constraints to perfectly suits devices' screen size, using updateViewConstraints . Perfect on iOS 7 but with some glitches on iOS8 as on following picture: ./Users/dominiquevial/Documents/Informatique/Dev/Novae Marathon/_log/captures/iOS8 -