Can I have resizable by mouse views with Cappuccino ?
I mean, I need a "iTunes" layout as the layout sample code on their website.
But I wold like to be able to resize the areas with the mouse from the browser in order to customize the UI.
Can I make it ?
You can use a CPSplitView to put two mouse resizable views side by side. The divider between them can then be clicked and dragged with the mouse to reallocate space between the two views. This is the equivalent of Cocoa's NSSplitView.
Related
I'm essentially making a 'shopping cart' UI and I want it so that when the user hits the 'Add' button, a little tiny box-label appears at the bottom of the screen that says 'Added Item' or something like that.
My question is how to do that with my current set up. I am currently using a nested Grid inside of a Scroll view for the main content of the page. I want the box-label to fade in at the bottom of the screen and stay located at the bottom of the screen ontop of everything else even if you scroll, until the animation fades.
Now i figure it doesn't make sense to add it into the grid since the grid's end will be out of view in the scrolling part of the scroll view, and same for the Scroll View. I am considering nesting the entire scroll view inside of a stack layout but i fear the button will just be located at the end of the stack layout under the scroll view instead of on TOP of the scroll view. How do you recommend I achieve this effect?
I prefer not to use a custom renderer if possible due to my lack of experience in the three separate platforms.
Thanks
Make vertically oriented stack layout. When you need to add you animation add it programmatically to the stack. When it finishes remove it from stack. Your scroll view will not affect animation
UIScrollview scroll is not working when i tested application in device (iPhone 5), But scroll is working properly in iPhone 5/5s/6/6 Plus simulator. I am developing application using Xcode 6 and UIStoryboard with AutoLayout.
I set the top, bottom, left and right constraints of UIScrollview with relative to Superview. And i also set the constraints of every UIControl which is in the UIScrollview.
Has any one have solution regarding this issue?
Please see below screenshot for reference.
It's probably easiest to have the scroll view contain a single view, which then contains all of your scrollable content. That single view should be anchored to all 4 sides of the scroll view, and if it's only meant to scroll vertically (which is what your screenshot makes it look like), then set the content view to be the same width as the parent of the scroll view.
To make sure an UIScrollView scroll, you have to check
Size
Your content View is bigger than your Scroll View. If you want it to be scrolled vertically, make sure its higher; horizontally, wider.
Constraints
Make sure your Scroll View is pinned to its super view, Top, Bottom, Leading, Trailing.
Make sure your Content view of Scroll View DOES NOT have CenterY constraint set to Scroll View, cause that'd make content view stuck with Scroll View and it'd never be able to scroll. (That happens to me the last time I was stuck)
Interface Builder settings
Make sure the check in Interface Builder under Scroll View is checked:
Scrolling section, Scrolling Enabled.
I have an (big) NSImageView embedded in an (smaller) NSScrollView. I want to automatically scroll if the mouse goes near the edge of the window, how do I do this?
You could create an NSTrackingArea to be notified when the mouse enters a particular area of a view and then use one of NSResponder's scroll.. routines to scroll the view.
Cocoa has a built in method called NSView.autoscroll(with:) which will automatically scroll the enclosing scroll view when tracking mouse events and the cursor is outside of the scroll view's clip view.
I would like to have buttons inside a scroll view (or another solution to creating a scrollable button bar).
I have buttons placed side by side in a row along the top of a view. As a user resizes the window to be less wide, fewer buttons can be seen.
When all the buttons cannot be viewed, I would like the user to still be able to access all the buttons by scrolling horizontally through them.
To visualise this, imagine in Safari if you open too many tabs to fit in the window - I would like the user to be able to scroll to the right and reveal the tabs that weren't on the screen.
You need to deselect the springs (for the custom view of the scroller) in the autosizing setter so that the view doesn't shrink along with the scroll view when you resize.
I'm making a Cocoa application which has an NSSavePanel. During the lifetime of the modality of this panel, I allow the user to toggle between two different accessory views (call them View A and View B) for this panel via a checkbox in both of these views. I'm building on Snow Leopard.
View B is larger heightwise than View A. When switching from View B to View A, Cocoa starts with the height of the save panel plus View B's height, draws View A at the bottom of the panel with a blank space at the top of View A and then slowly animates this space away so that View A slides upwards. This looks okay.
When switching from View A to View B, Cocoa draws View B's components at the very top of the save panel so that they overlap the save panel's own components (text fields, buttons, etc.). It then slides View B downwards to underneath the save panel's own components. This looks ugly.
First off, I'm not sure how to reason about the proper way to animate the transition from View A to View B. Secondly, I'm not sure to accomplish it. I suppose I could just have one accessory view and just show and hide components in this when switching from basic to advanced mode, but this seems kind of a kludge.
Any suggestions? Thanks in advance.
The easiest way I've found to do things like this is to use an NSTabView with no visible tabs that does NOT draw the background. A and B are subviews of the tab view. Use the checkbox to toggle between the subviews of the NSTabView -- create an action method that uses -[NSTabView selectTabViewItemAtIndex:]. Then you don't have to worry about the height changing and Cocoa handles the transition.