I have UIViewController with UITableView which fill entire screen (I am using auto layout). When I add some view to the view above table view sometimes when I push to this view controller I see black screen, but only in the place where should be table view. Sometimes when I remove the view and add other then works sometimes not. So I have no idea why sometimes works sometimes not and what can cause thsi error. I can even add only IBOutlet to the one of the constraints and then I see black screen, if I then delete the view with this constraint, then works and if I then click undo and the view comes again, then works. I don't undernstand it.
Can someone help me?
The default tableview background colour is black so it may be that you're table isn't being populated. Try setting the bg colour of the table view to something obvious (e.g. red) and also check your datasource is available when the table is trying to layout.
Sorry, it was my error I didn't notice. I set view of my view controller to tablew view in the interface builder.
Related
I am using SWRevealViewController to show front and rear view. Inside rear view I am using full view Mode and insert table view, but table view cell content is not lies in the middle of screen. it little swap to the right side. I have tried almost every thing, from storyBoard I have used Auto layout and inside cell.m file inside layout subview class but no result.
But when I tap on cell content it appears in the middle of screen, As I wish. please suggest me so if this screen load content appears in the middle of screen of tableview. Your suggestion is highly appreciated. enter image description here
[
you can see how weird it looks
Now I got the answer, we can edit the sw reveal rear width to screen size and same applied to table view size, In this way we can bring the content of tableview in the middle of view enter image description here
I'm having trouble setting a layout for my iOS app. The entire app is shifted right for some reason as you can see by the label and buttons which are in the middle of the scroll view.
I also can't seem to display the entire table. In the screen shot below "another Item" is supposed to have a checkmark and it is only visible if I shift the table in Main.storyboard far to the left where the actual label for the cell item is half visible.
I have a scroll view inside of the view controller and then a label and three buttons as well as a table view with table view cells.
Thanks to Lucas for the answer
Are you using Auto Layout with that storyboard? Looks like you might not have set your constraints up properly. You might also want to take a look at Xcode's new View Debugging functionality.
I am trying to create a UI just like Facebook's comment screen on mobile.
I got a UITableViewController on my storyboard. I need to insert a view docked to the bottom of the screen to place a text field. Since the tableview is taking the full screen, I can't do it on storyboard and I think I need to do it programmatically but how? Should I modify the constraints that stretch the tableview to the edges and insert the views or what?
Thanks.
You can always add table view to normal UIViewController and below it add another view.
In my application, I have used UICollectionView:
Inside the collection view cell, I have a view button.
If we click on that button, another view will be opened displaying the details of the graph and an enlarged image.
The problem is that if I click on the view button in the cells present of left column i.e. first column everything is working properly, but if I click on the view button in the right side column or 2nd column cells, the detail view does not appear and they become unresponsive.
I do not understand the problem. It is working well for left side cells, then why is it not working for right side cells?
Check your view dimensions and make sure that collection view is not overlapped with other views, it seem that it is not recognisisng the ui gestures at those points..
I got the problem, the problem is i am adding the collection view to a subview named display view and then adding to the parent view, but the main screen frame width is less than the collectionview so the uievents are not recognised at that column part, so i have deleted that display view and added the collection view directly to the parent view and now it is working..
I have a screen in my storyboard where I would like to embed a container view into a portion of the screen. I can't figure out if I should add a new containerview or view from the object library and then drag in a collection view controller or collection view (or tackle it a different way?). I've tried all combinations but just end up with the embedded view being shown black even if I drag collection view cells and set a background colour to test it. Once I can get this working I plan to populate the cells from an external database.
Any suggestions please? I'm doing this using storyboard as far as possible.
Thank you.
After you drag a container view into your view, you automatically get an embedded view controller, whose size is matched to the container view's size. You should delete that controller, and drag in a UICollectionViewController. Control drag from the container view to this controller and choose embed when you let go -- this will resize the collection view controller. You can give the collection view a background color, so you will see where it is, but giving the cells a background color won't show up until you implement the methods in the controller to populate those cells.