ios-autolayout

Auto layout issue with a row of image views

只谈情不闲聊 提交于 2019-12-12 03:33:16
问题 This is driving me nuts! I am trying to show a row of images of followers to a profile in my app. The idea is for it to be 5 images where you could theoretically click on them and move to their profile. Here is what I am having troubles with now : I've never had to ask about auto layout before so I don't know what to show you all for your help. Is feel like this is a silly problem... Here is the setup: Designed in a separate XIB All elements are encapsulated in a UITableViewCell Any help

Autolayout with Scrollview in Xamarin

六眼飞鱼酱① 提交于 2019-12-12 02:43:05
问题 It's driving nuts... I am using storyboard....but if it this can be done programmatically, I would change immediately I have a scroll view set to fill parents view (x and y) I add the scroll pin spacing handlers to the borders of the view (in all four of them) I add a button near the bottom with the constrains When rotation occurs I'm unable to see my button. I haven't found any example on how to correctly use scrollviews in xamarin, if anyone knows any example would be appreciated, I'm new

issues with label text layout while changing the font for app using auto layout

烈酒焚心 提交于 2019-12-12 02:05:22
问题 I am working on auto layout in my app.I have a functionality to increase the font size of entire app through slider movement.The issue is when i increase the font size the text of the label turns into ellipses. I have given the constraints to my label a fixed width and increasing variable height but this doesn't solve any problem. Do i need to give line break mode (word-wrap) and specify the number of lines for every text or there any other solution to this ? Any help will be appreciated. 回答1

When two labels show side by side with using the Masonry, how to make the width of each label show depending on its content?

你。 提交于 2019-12-11 23:07:23
问题 I want to use the Masonry to show two labels (UILabel) in the a line (view). But the left label is much wider than the right one. They shows like that in this picture.(The green label and yellow label.) The content compression of them are UILayoutPriorityRequired, I want the left side of the left label is equal to its superview and the right side of the right label is equal to its superview. Then how to make the width of each label show depending on its content with even more labels in a view

UIStackView Autolayout constraints

淺唱寂寞╮ 提交于 2019-12-11 17:04:33
问题 I am creating a UIStackView with two buttons + & -. In the landscape mode the stackview it looks like this with vertical axis. And in portrait mode it has horizontal axis like this: Problem: Each button +/- is 50 points high. In landscape, I set w=50 & h=140 for the stack view whereas for portrait I set w=200 & h=50. I set the spacing property of UIStackView of 20 points in landscape and 100 points in portrait. I use 'Vary for Traits' to define different constraints for the two modes as well

UIViewController wrong size after UISearchController

丶灬走出姿态 提交于 2019-12-11 15:55:32
问题 I have an UIViewController and in this I show UISearchController in the navigationbar . In ios11 . + this will increase the navigationbar height. That's okay for me. So the user click on my button to show the searchbar , and I show it. If the user click on the cancel button I remove the searchbar . The problem is occuring when the user click on the button to show the searchbar and after this, the user wants to go another UIViewController . I load the another UIViewController and I got a black

How to insert a UITableViewCell at bottom with animation?

馋奶兔 提交于 2019-12-11 12:46:42
问题 I have read https://stackoverflow.com/questions/ and tried as this: //UITableView self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; self.tableView.rowHeight = UITableViewAutomaticDimension; self.tableView.estimatedRowHeight = 50; //Update the full code for the "return" key action - (void)inputViewDidTapReturn:(MyInputView *)inputView text:(NSString *)text{ NSLog(@"send text-----%@",text); [self.messageManager sendMessageTo:self.sessionID message:text completion:^(BOOL success

NSLabel Autoshrink with top constraints

偶尔善良 提交于 2019-12-11 05:33:05
问题 I try to figure out autoshrink option in UILabel with regarding top constraint. I have UIView and three labels. One of them has autoshrink option on. It has constraint to be centered, and has Trailing and Top constraint which should shrink label when changing size of UIView. If I make UIVIew thinner, font size is decreased, but if I change height of UIView font is not changed. Constraints on UILabels : Align Center X to Superview Align Center Y to Superview Trailing Space to Superview >= 50

How to change height Constraint of UIView in UitableviewCell when using UITableViewAutomaticDimension

和自甴很熟 提交于 2019-12-11 05:07:01
问题 I have a UIView in the UITableViewCell , which needs to change its height when user taps on "less/more" button My code is - (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath { return UITableViewAutomaticDimension; } 回答1: Hook items height constraint as IBOutlet and change it in cellForRow like this cell.viewHeightCon.constant = // value and before return cell add cell.layoutIfNeeded() 来源: https://stackoverflow.com/questions/48401654/how-to

Autolayout resize UIButton with text and then the container view

微笑、不失礼 提交于 2019-12-11 04:44:30
问题 I am loading a view with buttons from a xib file. The button (green) has localized variable text. I need the UIButton to be resized dynamically with the text and then the container view (red) should be resized to the button size, so that container view does not have extra space. Since the whole container view should be horizontally middle in a view with a clear background and the text should not look like aligned in left or right. I have added background color to mark clearly :) Is it