I use NSOutlineview to group a view(the view align left side of NSOutlineView), So I subclass the NSTableRowView as a view. then putting NSTextField for something control. But NSTextField can't work inside NSTableRowView.
Anyone can give me advice.
Thank a lot.
Related
I have an NSSplitView in My window. the left is an NSOutlineView. When I click the OutlineView's item, the right Which is a custom ViewController's view will look like the below:
Screenshot:
then,a problem occurs that the two NSTextView can't editable while editing the textview. however,I have make it possible to edit it.
Screenshot:
Am I missing anything?
Any hint in the right direction is highly appreciated.
Thanks
This is my demo code:github.com/ljz2012008/TestN.git
When an NSTableView has the style NSTableViewSelectionHighlightStyleRegular, the group rows have a very nice background and design overall.
I'd like a NSTableViewSelectionHighlightStyleSourceList Table view, but with the same header style.
Has anyone an idea how to do this, without having to subclass it?
I guess there is no other way then subclassing it, but it's pretty easy:
Just make a subclass of NSTableRowView, override the DrawRect method.
Check the property self.isGroupRowStyle. If it is, then write the code to draw it.
Else just call [super drawRect:dirtyRect];
In the TableView Delegate, return an instance in the
tableView:rowViewForRow: Method.
thanks anyway
I have UiTableView containing some data, and I want to scroll the UiTableViewCells horizontally to the left or right to show some UiButtons that act some action relatif to the content of the cell.
How Can I do this?
I'm thinking in creating custom cell, and putting a scrollView in it, May this did the trick?
There is a tutorial for this at http://idevrecipes.com/2011/04/14/how-does-the-twitter-iphone-app-implement-side-swiping-on-a-table/ with sample code. He is using a UISwipeGestureRecognizer to trigger an animation that pushes the cell off the screen.
You could use a swipe gesture recognizer attached to your cell.
You can add a UIScrollView to the contentView of a UITableViewCell. If you want to scroll the content using buttons, simply overlay the UIScrollView with buttons and make them call the various scrolling methods of UIScrollView.
Nested UIScrollView (UITableView inherits from UIScrollView) are quite clever about detecting touch conflicts and resolving the users intended gesture.
https://github.com/JonasGessner/JGScrollableTableViewCell might be what you're looking for. It implements this using a UIScrollView inside the cell (just like the iOS 7 mail app).
(Yes the answer is a bit late, but it's never too late! :P)
i have to set some objects like UILabel and UIImageView in my scroll view from Interface Builder. But, how can i do?? I know that this can be done from code, but for a multilanguage app is too annoying :)
EDIT:
I solve the problem!
I explain again and better the problem : i had to "draw" my view with UIScrollView with Interface Builder because is the easiest way to manage multilanguage view. First, we have to add UIScrollView in our view. But in this case we don't be able to insert objects in a point that have height > 460. So, i've added a scroll view, but not in my view and i've modified its height and i now add objects everywhere i want.
Try to be more specific. What problems did you encounter? Generally all you need to do is to drag&drop your outlets in the scroll view (and optionally bind them to IBOutlet fields you may have in your controller class, according to what you need to do).
I solved the problem! I explain again and better the problem : i had to "draw" my view with UIScrollView with Interface Builder because is the easiest way to manage multilanguage view. First, we have to add UIScrollView in our view. But in this case we don't be able to insert objects in a point that have height > 460. So, i've added a scroll view, but not in my view and i've modified its height and i now add objects everywhere i want.
I am passed a NSView from a class and I need to add on another NSView at a certain point. How do I do that?
Thanks in advance.
You can add a view to another view by sending the addSubview message, like this:
[MyView addSubview:MyOtherView];
Don't forget though, you are responsible for how that view displays. Make sure you set its bounds.
You can position the new view when instantiating it using the initWithFrame: method that'll create the view and position it within the superview (i.e. the one you'll add your view to with the already mentioned addSubview: message).
PS: The View Programming Guide - is your friend.. ;-)