Hi I am designing a UI similar to
My current approach is aligning a custom NSView for each row and placing it vertically based on the Y position,
I would like to know the best approach to design this.
It is doable with NSTableView, NSCollectionView, NSStackView but the problem I am facing the scroll should only happen on button click of top and bottom arrow.
Related
I am trying to implement interface which elements are resized on some events. I have a button and a NSCollectionView inside the NSView. The problem is as follows: when resize of the button affects the size of View, sometimes elements of NSCollectionView become invisible. The size of button is changed programatically by enabling a constraint of bigger width.
While some elements are invisible, the NSCollectionView act like if they were visible as usual - I can scroll the collectionView and can see the selectedItem value.
The Layout of NSCollectionView is Content Array (Legacy)
Here are some screenshots:
Everything is ok from the start
Some elements are invisible after the button became wider
Noticeable thing: If user resizes the View so that items need to be rearranged, items in NSCollectionView become visible again.
Here is the link to XCode project:
https://www.dropbox.com/sh/annv6d7a52h16u6/AACeOUsv2E-ac9q28V3MPjAsa?dl=0
#Willeke have found a solution:
Switching off "Autoresizes Subviews" of the NSCollectionView fixes the problem.
I have implemented a image slider with a UICollectionView inside a UITableViewCell which the user can slide to left and right. I want to create two buttons on this UITableViewCell so the user can also tap on that buttons to slide the images.
I've done this by adding the buttons on the images inside the UICollectionViewCells but with that the buttons also are swiping when the user swipes to left or right or taps the buttons.
I tried to fix the buttons on the UITableViewCell, but anyhow the buttons does not get displayed, when I do it like this.
So how can I achieve this, that the buttons are fixed inside the UITableViewCell and the UICollectionView inside the UITableViewCell can move it cells without effecting these two slider buttons?
At storyboard it looks like this:
Can't rearrange the buttons:
Add the buttons directly to the content view of the table view cell, don't add them to the collection view. That way they will stay in position. If you can't see them it's possible that they were underneath the collection view and were obscured. Change the order of the views in interface builder by dragging and dropping in the document outline. This changes which view is on top.
The document outline is the view you have posted as a screenshot in your question, starting at "brandsCollectionTableViewCell". The outline contains the subviews of the cell. Views with the same parent, like the image view, label and buttons currently shown in the outline, will be ordered "on top" of each other by their position in the list. So you drag the items in that list to change the order, or select the buttons then go to Editor -> Arrange -> Send XX to adjust the position.
Use the Xcode view hierarchy debugger to help you understand what is happening (that's this button on the debugging toolbar):
The 3D view will let you see where your "missing" buttons are.
If you really want to include the buttons in the collection view, then you need to use a custom collection view layout implementing floating views. That's not a straightforward task, but I've written something about it here.
I need to create a view controller like this or like user instagram's profile
not exactly same, I just want to add label and buttons and collection view,
but I want all of this in scroll viewController
I think I can't do that from storyboard, so how I can make a view controller scrollable programmatically?
and then I want to add the label and buttons inside the scroll , I can do that programmatically , but how I can add collection programmatically inside it?
One of the possible solutions is to make the whole container a "UICollectionView" -or "UITableView", depends on what exactly you want to build-, and then, create a custom cell for each area depending on what do you want to display in it.
It might sounds a little bit strange in the beginning, but you will notice that it is a great technique to handle scrolling in your scene, including some of extra nice features, such as:
auto scroll content resizing for "UIKeyboardWillShowNotification" and "UIKeyboardWillHideNotification" events.
the ease of showing and hiding sections from the UI (actually they are cells!).
UPDATED: For example:
You can make the first part (red rectangle) as a UICollectionReusableView and customize it by adding your images and button in it, second part (blue square) as a UICollectionViewCell and so on...
This is the general idea of what how you can do it.
I'm getting stack in the design UI for an news application, i just want to make a transparent image under the 1st cell in a UITableView, and the Bar Menu on the top also transparent, which control they used for this one, like the below image
http://i.stack.imgur.com/C1C8N.png
Could anyone help me....
Thanks alot!!
I think it is a UITableView, where the first cell is customized in order to contain the large image. Then, they might be using a UIScrollView as the view for the first section, or a custom header view for the whole table - depends if that top stories "scroller" scrolls together with the rest of the talbe.
The rest is a "traditional" combination of a tab bar and a navigation controller.
I have a grouped table view that does not need to scroll. I'd like each cell to highlight as the user moves their finger down the screen and call didSelectRowAtIndexPath on release.
This behaviour can be seen done by apple in 'settings > mail > add account'?
I can't seem to replicate it myself, all I can get is the default, where the cell deselects as soon as the user moves their finger.
I think the way that that example is done is not a UITableView, instead i think they draw the "table" from buttons. This would then not allow the scrolling feature while allowing you to have the buttons highlighted.
Hope this pushed you in the right direction.
Seb kade