ios-autolayout

UIScrollView Controller not scrolling fully

允我心安 提交于 2019-12-23 04:53:06
问题 I am pretty sure this has something to do with the dreaded AutoLayout. (been trying since 2days to get hang of it) So I mastered it somewhat, but now I have problem where my UIScrollView is not scrolling fully down, pictures are much better at explaining these things this is the scroll view this is the content view so the problem is the scrolling is happening but then again it springs back up. So I am not able to click on the signup button EDIt 1 回答1: Edit: I have created a little example on

Button on bottom of screen: iPhone X vs regular screen

荒凉一梦 提交于 2019-12-23 04:34:52
问题 I'm trying to optimize an app for the iPhone X screen. Currently it shows black or white bars on most screens. As example I will use the PaymentMethodsView . The PaymentMethodsView is a custom UIView containing 1 or 2 buttons in a horizontal StackView , the superView has a gray background. This StackView is currently constrained with 16px to the superview (all 4 sides). Currently it looks like this on the iPhone X (and on regular iPhones the view is just on the bottom of the screen: What I

ios 11 - UIButton inside UIBarButtonItem causes an autolayout error

痴心易碎 提交于 2019-12-22 05:18:18
问题 I've a known issue with adding a UIButton into UIBarButtonItem. I've tried to add auto layout constraints as suggested in stackoveflow but I'm getting an error described as below. UIButton *sortButton = [UIButton buttonWithType:UIButtonTypeCustom]; [sortButton setFrame:CGRectMake(10, 0, 100, 30)]; [sortButton setTitle:@"Sort" forState:UIControlStateNormal]; [[sortButton titleLabel] setFont:[UIFont boldSystemFontOfSize:13]]; [sortButton setBackgroundImage:[UIImage imageNamed:@"backgroun-button

Autoresizing not working in iOS11 / XCode 9

孤街醉人 提交于 2019-12-20 14:06:39
问题 It appears that the Autoresizing of views is no longer reliably working when building for iOS11 with XCode 9. The layout of several views end up with the positioning of controls as they are in the XIB, but the appropriate resizing has not happened. This has been working fine in iOS10, and works with our old app running in iOS11. However, rebuilding the app the positioning and sizing fails. Has something changed that impacts the use of autoresizingmask ? Is there a way to automatically convert

How to change font size for iPhone 4 and IPhone 5 in auto-layout?

杀马特。学长 韩版系。学妹 提交于 2019-12-19 11:24:38
问题 I am trying to change font size of uilabel for iphone 4 and iphone 5 using autolayout and size classes. IB is giving option only for ipad and greater phones like iphone 6 and 6P . If i change font for wR and hR then it changes fonts size for iphone 4 , 5 and 6 which is wrong in my case . Please help me in this regard. 回答1: Unfortunately , Apple Provides minimum consideration for all iPhone's(4,5,6,6p version) Portrait Mode Compact Width - Compact Height or Compact Width - Regular Height . So

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

Xamarin iOS: Auto Layout within scroll view?

白昼怎懂夜的黑 提交于 2019-12-17 21:35:49
问题 I have a scrollView on my storyboard on which I have added top, left, right, bottom constraints in order for it to resize automatically in accordance with different screen sizes. The problem is that if I add image view or any other stuff within this scroll view and place constraints on this image view to maintain some distance from top, left, right and bottom of the scrollview boundaries. It just doesn't work. I Would like to have everything resized according to the screen size of the target

Swift default AlertViewController breaking constraints

微笑、不失礼 提交于 2019-12-17 10:33:38
问题 I am trying to use a default AlertViewController with style .actionSheet . For some reason, the alert causes a constraint error . As long as the alertController is not triggered (displayed) through a button, there are no constraint errors on the whole view. Could it be that this is a bug of Xcode? The exact error I get looks like this: 2019-04-12 15:33:29.584076+0200 Appname[4688:39368] [LayoutConstraints] Unable to simultaneously satisfy constraints. Probably at least one of the constraints

UITableView dynamic cell heights only correct after some scrolling

北城以北 提交于 2019-12-17 10:12:16
问题 I have a UITableView with a custom UITableViewCell defined in a storyboard using auto layout. The cell has several multiline UILabels . The UITableView appears to properly calculate cell heights, but for the first few cells that height isn't properly divided between the labels. After scrolling a bit, everything works as expected (even the cells that were initially incorrect). - (void)viewDidLoad { [super viewDidLoad] // ... self.tableView.rowHeight = UITableViewAutomaticDimension; } -

What is 'Vary for Traits' in Xcode 8?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-17 04:11:29
问题 I am using AutoLayout and Size classes, but with release of iOS 10 and new Xcode 8.0, there is one new option Vary for Traits . Is this replacement of Size Classe for different width and height of devices. By selection of width checkbox, it displays varying 14 compact width devices . By selection of height checkbox, it displays varying 18 compact height devices . By selection of both checkbox, it displays varying 11 compact width regular height devices . How to make use of this options ? Can