I've got a scene in my iOS app in Xcode in swift.
The scene has a View > Scroll View > ContentView (with text fields, labels, images etc.).
At the bottom is the tab bar and there is a grey area above (like another tab bar but empty).
The question is how to remove the second (upper bar)?
Hope the picture clarifies:
Thanks for all the answers in advance!
Related
I want to have a window with a hidden title, as seen in Safari or Xcode, but using a titlebar accessory view instead of a toolbar (I want more control over arrangement and content than a toolbar provides). Is this doable?
I haven't quite been able to make it work. If I set my window's titleVisibility to hidden, and my accessory view's layoutAttribute is bottom, then the title area is empty except for the standard close/minimize/zoom buttons, and my accessory view appears below that.
If I change the layoutAttribute to right, then my accessory view appears to the right of the standard buttons where I want it, but the bottom is cut off because the title bar isn't tall enough, and the view also doesn't resize horizontally with the window.
Is there a way to make this work? Or do I have to use a toolbar?
Update: I used Xcode's visual debugger to examine Xcode's own title bar, and found that it is using a toolbar. The debugger refuses to attach to Safari, so I'm left wondering how it does the new tab button. I imagine that button is a right-pinned accessory view, and the rest is a normal toolbar. Safari's toolbar is still customizable, so that seems most likely.
I decided to go ahead and use a toolbar, and it's working pretty well.
I took my NSTitleBarAccessoryController subclass and made it inherit from NSViewController instead.
I created a non-customizable toolbar for my window, with a single "Image Toolbar Item" in both the allowed and default sets.
The toolbar item has a height of 32 and a max width of 10000 so it can stretch to fill the title bar.
In my toolbar delegate, in toolbarWillAddItem:, I instantiate the view controller from the nib and put its view into the item.
A text label that is effectively the new window title has its value bound to the window's title.
To match the spacing in Xcode's title bar, use a left and right margin of 1 pixel (zero will cut off the edges) and a top margin of 5.
window.titleVisibility = .hidden moves the toolbar into the title area.
Storyboard has a horizontal scrollbar for you to scroll to view other scenes, but the scrollbar is not present when previewing the storyboard scene. How do you scroll storyboard preview? (Assuming I am not using magic mouse)
What about Shift + Mouse Scroll? Or if you have Macbook, slide two fingers left or right on trackpad to scroll.
Just press and hold on the edge of the preview.
I have a tab bar with 2 tabs. I ctrl-dragged from a button in the first view and released it on the second view and chose "show". The storyboard shows the tab bar on all the scenes, but when I test the button in the simulator, although it does segue to the second view, the second view doesn't show the tab bar.
How can you keep a new view from covering the tab bar after a segue?
Maybe I need to ctrl-drag somewhere else or do this programmatically?
Here is a screenshot of my story board.
When I segue to the "Read Article" view controller I would like to still see the tab bar and star icon at the bottom.
p.s. This may have been answered before with Objective-C, but I am looking for a Swift answer. Thanks.
I would to remove a title of the bar item and show only the images also in the space of the title (size of the image 60x60 not 30x30)
its possibile only wih storyboards or IB ?
thanks a lot
I define a UILabel inside a UIScrollView in my ipad.
But how to display the UISrcollView vertical Bar when the text is bigger than the scrollView ?
When I touch the scrollView the vertical bar appeared, but how to display it without touching ?
Regards
Fred
I think, its not possible. Setting showsVerticalScrollIndicator and showsHorizontalScrollIndicator properties you can display the scroll bar.
You can use flashScrollIndicators when the view becomes visible. It will guide user that scrollable content is available.