How to set iOS ScrollView in DetailViewControl? - ios

You need a scroll view to implement it as shown in the picture above. But I don't know how to implement it. That's the only thing on the storyboard that's missing.
And when you run it, you just move the scroll bar next to the screen, and there's no change on the screen.
Do you have any suggestions?

Have you tried to deselect Content Layout Guides?

Related

Xcode UITableView image does not align properly on simulator

I am working on a project on Xcode7.3 using swift using autolayout. I am stuck with an problem with the UITableview not displaying properly on the simulator.
I created a ViewController and dragged a TableView into ViewController. Then I dragged a UIView and UIImage ontop of that TableView (To display as a header image). I also dragged a UIImage onto the prototype cell. They are all aligned in the center horizontally and vertically. However, when I run the app, they don't show in the middle of the screen.
As shown in the UITableView_Problem Image, the images are offset to the right. What is also weird is that when I rotate the screen, the scrollbar on the right does not go all the way to the right. The images appears to be in the center of the screen if I consider where the scroll bar is the end of the screen. But that doesnt make sense because the bottom bar items spans the full width of the screen.
However, if I create a UITableViewController from the story board instead of dragging a TableView onto a ViewController, I do not have a problem at all. (Image3)
It is frustrating because I wanted to add a text field for keyboard at the bottom of the screen just like the comment section in Instagram app. And after hours of searching, it appears that the only way to do that is to drag a tableView onto a ViewController. i stack imgur com JC5Pw png
Could anyone please assist? Much appreciated
Blockquote
note: I dont have a developers account yet so I cant check on an actual device
You are designing your interface in the wRegular/hRegular (or universal) size class. You will need to be very good about your constraints or develop a layout for the wCompact/hRegular size class for iPhones in portrait mode. You can change this by selecting here the blue part on the bottom of your storyboard
Thanks Dan for your prompt response! I added constraints to everything except for the tableView. Dont know what I was thinking as I have been troubled by this bug for a few days. Everything works fine after the tableView constraints was set!

Xcode, Button not showing on UITableView (Basic level)

I'm having a problem performing a basic action in xcode. I want to add a button to a TableViewCell using the storyboard. I'm able to add it: drag and drop from the palette. But it is supposed to be shown when I run the app right? isn't it? I see the TableView, I see a label I've putted in the cell but I don't see the button. That's very annoying.
This is how it looks in the storyboard:
Have you tapped the "Debug view hierachy" button to see whats going on in the view. The button shows at the bottom when you have an app running in debug.
This ViewController's size probably does not match the simulator's or your device's size. That is why the button does not appear.
Make sure to either add constraints when using AutoLayout or setting the button's position in code.
Hope that helps :)

Unwanted UITableView Animation

I have a simple UIViewController_A in a Storyboard with a button on it. The button modal segues (page curl) to UIViewController_B which has a container view. The container view then embeds UITableViewController_A. The table displays 1 section containing 3 custom static cells. Each cell has a label on the left and a switch on the right.
When I click on the button, the table is properly displayed where I want it but the cells content, labels and switches, are animated to their positions.
How can I disable this animation? I suspect it is the embedded tableview getting animated while being resized, but am not sure.
I put a simple demo of the problem on github : https://github.com/droussel/UnwantedAnimation
Thanks!
I noticed that only the middle cell animates in. If I increase the cells to 5, the middle 3 animate. This only happens with the partial curl animation -- this looks like a bug in the auto layout system to me. If you turn off auto layout, the problem goes away.
I don't know much about storyboard concept.But I suspect you are starting some animation in button action to have an animation like paging.If so, then just commit(end) your animation after achieved what you want.
[UIView commitAnimations];
Hope it will help you.
In Storyboard segue to that scene/view, open the Attributes inspector, and uncheck ANIMATES. Turns out there is a bug with iOS8 with Partial Curl/Animates.
Hope that helps!

Storyboard UIView cuts off objects when scrolling

Using Storyboards, I have a scrollview with a UIView embeded into it. On that UIView I have some text and a button. The button is down a bit, for this question.
When I scroll in the simulator and on the device, the UIView gets cut off where the button is. (button there to show the cut off)
Above pic is before scrolling.
This pic is showing the scroll UIView and the button embeded into it being cut off.
I have set the Size Inspector to 1000 height.
I have searched on stackoverflow and I have not found an answer as of yet.
Thanks for any help.
It looks like the hierarchy of this particular window is not ordered properly. You need to rearrange your hierarchy. To do this, go to your storyboard, and click on the little button on the bottom left that looks like the play button with a box around it. From there, you can adjust.
I had the same issue in an app i was working on. For some reason, it didn't work for me either. I suggest you try creating the the scrollview and the view inside it programatically instead of storyboard for this particular view controller. It will work like a charm. You will also have to find the length of the inner view and then set the size of the scroll view to the size of the view embedded in it.
I figured it out. Not sure if this is the preferred method or just a work around.
The main difference is I connected the last ScrollView, not the First one. Not sure why but it works.
Before, (pics above in original post with cut off button), it would cut off my UIView. I still would like to know "why" it does this. Thanks for the reply's.

Simple Picture based App

I'm developing a iPad app which is just a series of pictures, and I'm stuck. I've managed to link up a Tab Bar Contoller to the 6 View Controllers and all seems to work well. But I'd like to be able swipe to the next View Controller once the user has selected the button. How do I do this? The swipe gestures don't work for me. Here's a snapshot:
I think you are looking for UIPageController. This is the control that is used in the iPhone Weather app to allow you to swipe from city to city. Go here to see the full documentation on the control.
That's not usually how Tab Bars work in iOS, but…
What it sounds like you're after is either a UIScrollView with paging enabled (keep in mind you'll have to set the scroll view's ContentSize) or a UIPageViewController (if you don't want to deal with sizing explicitly and you're OK making a new UIViewController to house each image). I'd recommend the first option. The process would go something like:
Add the UIScrollView as a subview of your main view (remember, ensure to set pagingEnabled to YES
Add each image to the scroll view
Set the scroll view's content size to the total width of all images
Thanks for the clarification!

Resources