I have dragged a table view into my view, set it to static, set the number of cells and sections, changed colours, added controls and modified the size. When I run it though, the changes do not show up. Am I missing something here?
Related
Actually I'm using XCode 7 and I'm trying to lay out a static table view in IB. I have "sizes classes" ticked (adaptive layout) and the table view is taller than the default square scene of 600x600 points. I can work fine with the cells in the top 600 points of the scene, that is its height.
When I scroll down the height of the scene, I can't select table cells by clicking on them in the scene (but I can in the outline). When I drag any object (e.g. a label) onto one of these cells, it goes into the view outside the cell and when I put the object inside the cell by dragging it onto that cell in the outline, I can't see it on the scene neither move it by dragging (it's like it was behind the cell's content view). May anybody help me?
It's a very weird behavior... I'm getting crazy!
I'm not sure if is the same problem, but I had problems editing statics cells when there are many. So in the size inspector of the view controller I set the simulated size to "freeform" and increase the height to unreasonable levels (2000), and then I can access the bottom cells.
Here a screenshot.
I have a tableview controller as my initial view. I added some text into it and it's not appearing. First i added some labels, and none of them was appearing, i thought maybe it was a constraint problem. So i added constraints and still didn't work. Then I made the cells basic rather then custom. In basic, it gives you text for you. And still the text isn't appearing. How can i fix this?
Note: This is a new project, I have tested this on a real device and have the same issue.
The table is created with the default prototypes of cells (Content field is Dynamics Prototypes) that need to create and add from the code. If you want to make a static cell, you need to do this in storyboard:
Select TableView
Set Content field in Attributes Inspector to Static Cells
Add your labels to Static cells
I am working on an app in the storyboard and building the basic layout. I had a dynamic prototype cell in a UITableView which I created a view in because I thought it would be a good idea to constrain some items in the cell with a view. When I tried to delete that view, I could not. I could not even move any other views outside of it.
I deleted the entire cell and tried to make a new one but even the new one had the view in it, name name too. Everything I tried to put in the cell was automatically put in the view as well.
Now the view is causing me problems because it's height is static and everything is constrained by it. It also seems to take on the roll as superview since everything is inside of it. So any time I constrain anything to the super view, such as the leading edge to superview constraint, it will actually be constrained to the leading edge of that view.
Why is the view being created whenever I make a cell? I have a feeling that it is some setting I mistakenly set but I looked through all of the settings of the view and and cell.
How do I get rid of this view that seems to be tied to every cell?
I've got a custom table view cell defined within a nib, I'm finding that whatever colour I set for view background in IB isn't being applied (why its not being applied is another question I have). So within the table view controller I added:
[localCell.contentView setBackgroundColor:LIGHT_BACKGROUND];
The cell colour now comes out as expected, however if in IB I set the accessory to anything other than none then the colour of the cell is shifted to the left by an amount about equal to the size of the indicator, behind the indicator I can see the background colour for the table.
Why is this happening?
TIA
The accessory view is not contained within the content view. You probably need to set the color of the background view of your cell rather than the content view.
[localCell.backgroundView setBackgroundColor:LIGHT_BACKGROUND];
I have a tableview that has a large number of fairly tall dynamic cells. I've tried creating the prototypes for these but I've run out of height room in the view.
I can't seem to extend the height of the table view, (or the view it's in). I also can't create the tableview outside the viewController, give it a larger height, and just link to it.
Suggestions? I know I can create the cells programmatically or from a separate nib, but I'd really like to do it via storyboard.
thanks,
Just figured this out myself. Try this:
Double-click the table almost anywhere except where there's an existing control. You can also double-click on the outer edge of the table.
Note that the table view will show a highlighted section that aligns with the cell you've clicked. You've entered some sort of selection mode.
Now use the mouse to scroll up or down. The cells will shift up or down as if you were running the app.