UIStackView Views are all on one row - ios

I have a problem with Views in a stackview where the different views are all showing on the same line and overlapping. This is in an app that used to be working so i'm not sure if this is a change to the language in some way. Does anyone have any idea why this is the cases and how to fix it?
storyboard
problem result

Related

xCode7 StackViews inside ScrollView overlapping views

this is my first job with xCode and I'm migrating an Android App to IOs. I'm attempting to create a ScrollView with some items inside of its content view. Below is a print of the Storyboard tree:
When I run the app, the items below the selected StackView, including it, do not appear correcly on the simulator. They are all overlapped at the top of the screen:
I have already double checked all the constraints, along with other properties on the views but could not find the issue. Any help will be very appreciated.
Thanks!
=========================================
Thanks, Imran. This helped me find the issue. But I still would like to understand it. As you can see from the picture below, some of the views in my storyboard have this "wAny hR" property set. Literally all the stackviews and, the Labels and Buttons which were messy. Once I remove this property and set the "Installed" one, they showed up ok. Any thoughts on that?

StackView within StackView - Overlapped Views

I have been trying to put together a view using Stack Views. The layout looks acceptable within Xcode but the 2nd, 3rd and 4th rows seem to overlap a small area when reviewed in the simulator.
There are some autolayout warnings and if I autofix one issue (Fix misplacement > Update frames) others appear. I basically end up toggling between placement issues. I must be fixing them in the wrong way.
Is there anything obviously wrong?
Why are these views overlapping each other?
What strategy should I use to fix the misplacement issues?

iOS Swift stackview inside a scrollview with constraints

I'm still getting familiar with iOS and the use of constraints. Initally had my layout setup with some constraints. But I ran into an issue. When entering text, my text fields are covered by the keyboard. I found some Apple docs: Doc One, Doc Two stating I should use a scrollviewin this case. It sounded easy enough but every time I put the content in the scrollview things go nuts. I've tried adjust my constraints in several ways, but nothing seems to help.
Anyone have any insight on what I'm missing?
Thank you
Before adding the Scrollview
After adding the Scrollview
If you use a UITableView with static cells and make your view controller a subclass of `UITableViewController, you don't need to worry about the keyboard. The table view controller takes care of keeping the focussed text field visible above the keyboard:
I wrote no code for that demo. It's all done in the storyboard. Here's the storyboard outline:

How to use auto-layout on a grid?

Maybe I'm going about this the wrong way, but I have a grid like that below and have been futzing around with Auto-layout with only limited success. Currently the cells are individual UILabels that are embedded in UIViews. These views are inside a UIViewController. I've used auto-layout to center the views but this does not solve the problem laying out the labels. I've looked a bit at Container views, but it seems that every cell has to be the same size. Tables? It seems to me that I'd have the same problem in custom table view cell classes. I'm exploring this anyway.
The views look like this:
Can someone tell me a good way to solve this.

UITableViewCell incorrect X positions

I've been searching through here and googling like crazy for a possible solution to this problem. Thus far I'm turning up exactly nothing that actually fixes it so I'm hoping someone can help.
I'm working on the UI for a iPad app. I'm doing it using interface builder. I worked with storyboards briefly but I don't like them all that much so I'm sticking with IB for now. Unfortunately I'm not very experienced with the workings of IOS Ui but it's been going relatively smoothly so far. In my app, I have a view controller, which holds a view containing a pair of sub views. One subview contains a rather windows like header bar (i like the look). The second contains a UITableView. The UITableView is set up properly as far as I can tell, and feeds it's info from a data source using custom UITableViewCells. The UITableView is set to grouped though currently there is only one section. The table is in edit mode by default because I want the user to be able to add new items and use the VC as a selection dialog. The view controller is presented (rather than pushed) using UIModalPresentationFormSheet (again, because I like the view) but I don't know that has any bearing on the problem. The cell border is flush with the X origin, the only reason the text isn't currently starting there is because I went into my cell and move the label over, leaving a gap between the edge of the cell and the label containing my text.
The Offending View http://bit.ly/144cbjT
The Problem: The UITableViewCells, for some reason are positioning themselves at X: 0. This puts them outside the border drawn on the UITablewView when you set it to grouped style. I could probably just turn off the border and get away with it, but I like the look so i want to keep it. I've tried messing around with constraints and anchor points on the cells, the content of the cells, the table itself, the view... I've tried simply moving my cell's labels over a bit. I've also had clipping subviews turned on and off. I've made sure the controls are being loaded properly from the XIB. I've made sure everything is added as a subview where needed. I've made sure I've tried everything I could think of short of setting the cell's X position in code. But since I'm not sure how to tell where the border is, I'd rather have the tableview or the cell do the work itself.
The question: How do I fix this? The selection accessory should be outside the grouping box. The text should be inside, not bleeding out onto the background like it is.I believe the content of the cell should be displayed inside the border within the yellow area.
The odd thing is, this is my fifth or sixth table in this app and I've been doing them all basically the same. Thus far this is the only one I've had trouble with.
Can anyone shed some light as to what's going on?
Thanks in advance
I think that to get this in code, you'd have to do something explicit, so the most likely candidate is a messed up IB file.
Since it doesn't cost anything, I'd just delete the tableView from the IB and then re-add it. If that doesn't work, try recreating the complete IB.
Hope that helps

Resources