I have made whole UI, but when I am adding a SrollView on the parent View , the view is shrinking , what should I do ?
Related
I am new in MacOS ,I want to show scroller indicator in NSTableview when scrolling , hide when not scrolling.
I am thinking to get the delegate of NSScroller , So i can detect when it scrolls,then hide/show it . Please help
Per the NSTableView reference page:
Table views are displayed in scroll views.
A table view itself doesn't know how to scroll. You have to put it inside a scroll view in order to scroll the table. If you're used to iOS and UIKit, that's a difference; UITableView inherits from UIScrollView, so on that platform a table view is a scroll view. In a MacOS project, if you insert a table into a view in Xcode's nib or storyboard editor, Xcode will actually insert a scroll view that contains a table view so you'll already have what you need. If you're creating the table in code, you'll need to also create the scroll view yourself.
Looking at NSScrollView, there's a property called autohidesScrollers which is...
A Boolean that indicates whether the scroll view automatically hides its scroll bars when they are not needed.
So, to get the behavior you're asking for, you need to set the scroll view's autohidesScrollers property to YES.
Of course, you can set that in the storyboard editor too, but again you need to look at the options for the scroll view, not the table view:
I'm using a TableViewController and I've added my own navigation bar on top to match the other tabBar pages that I have.
I had to place at the top an empty view to lower the starting point of the table view so it wouldn't cover my navBar, which was already annoying.
Now it looks fine except that when I scroll up my list both navBar and TableView go under the status bar.
I want my navBar to stay where it is and the TableView not to go under the status bar when scrolling.
For starting I can't add any other stuff in my scene if not under the table view and i get that that's causing the nav bar to follow the tableview up so that's part of the problem..
Xcode 7.1 swift 2.0 iOS 9
When creating this kind of structure (table + other elements), the best approach is to actually have a ViewController that contains a TableView and additional elements (like your navigation). Do not try to put elements, that are not part of the table itself inside the table.
Here is an example of the structure, where I have intentionally coloured the custom view (in your case the navigation) orange. As you can see, it is outside the table. This way the showing and scrolling of the table is completely separated from the other elements.
you can try self.edgesForExtendedLayout = UIExtendedEdgeNone;
All,
I'm using the Xcode 6 beta to build an iOS8 project using storyboard and swift. In the storyboard, I've created a Table View Controller as my primary view when the application loads and have added a label to the first cell and a label to the second cell.
The table looks fine in the storyboard, but when I run the application, the cells overlap. This is a brand new project with no other changes made or code added.
You can see both the storyboard and the running application in the photo below. Any ideas on what could be driving this?
Additionally, when I try to add a button to one of the cells, I get a grey box that covers 90% of the view.
I think I've had this issue. Try making some Auto Layout connections from the label to the Content View of the cell, and from the table view (and its cells) to the containing view, to force the views to be the proper size.
The following worked for me.
Control-click and drag from your label to left side of the cell it's in. When the modal comes up, check the box for 'Leading Space to Container'.
Repeat the same Control-click and drag process for each side of the cell, selecting the relevant Auto Layout option when it appears.
(Optional) Try to Control-click and drag from your table view to the each side of the containing view (if there is one), and repeat the steps from above.
Hopefully this works for you.
I have a project I was working on in XCode 4.whatever where the main view is a Netflix-style layout with a series of horizontally-scrolling scrollviews. The main scrollview may be scrolled vertically to see all of the horizontal ones. This is connected to a navigation controller so when an item is touched it performs a segue, whereupon the user can click a standard navigation bar back button.
This was working as expected with XCode 4.*, iOS 6.1. I have now upgraded to XCode 5 and iOS 7. The scrolling works fine upon initial load - the main vertical one and subview uiscrollviews. After navigating to an item and touching the back navigation bar button the main view won't scroll vertically. The subviews that are visible still scroll horizontally.
I am using a storyboard. The master view controller contains a Scroll View as the top item and a View with a couple subviews for the feature section at the top. The horizontal scrollviews are added programmatically.
The master view controller is a UIScrollViewDelegate and I have connected an IBOutlet from the main scrollview to my master view controller .h file.
That it works initially and then stops scrolling leads me to believe that the content size is being recalculated - and set equal to the frame size - after the navigation. However, I tried setting the content size within viewWillAppear to no avail. I did verify the routine was being called after navigation.
Any ideas on why the main scroll view loses its scrolling?
I have custom TableViewController with plain style Table View and it is embeded in Navigation Controller. I use Refresh Control on the table view and Black Translucent style of the navigation bar and all is setup in storyboard.
The first row of the table view starts right under the navigation bar item, which is ok, and the rows can scroll under the navigation bar which is semi transparent. When user starts to pull the table down to activate Refresh Control, the animation of the refresh object obviously starts at the edge of the screen under the Navigation Bar, and so the refresh object is always partially covered by the navigation bar which can confuse inexperienced users.
Is there a way to tell the TableView to avoid scrolling under the navigation bar and start the refresh control object animation right under the navigation bar? I tried to play with Scroller Insets on table view without any effect.
Thank you.
If you go into the properties for the tableview controller in your storyboard, you can change the size and positioning of the tableview to start after the navigation bar. The problem isn't an offset, but the size and position of the tableview itself. Just move the y position down to accommodate the nav bar.