weissi / frlayerednavigationcontroller Goto Github PK
View Code? Open in Web Editor NEWFRLayeredNavigationController, an iOS container view controller that works like a stack of paper with an API similar to UINavigationController.
License: Other
FRLayeredNavigationController, an iOS container view controller that works like a stack of paper with an API similar to UINavigationController.
License: Other
We have been using FRLayeredNavigationController in our project and one thing I have noticed but haven't been able to work around is that the title of the navigation bar seems to be centered as long as no UIBarButtonItems are added. As soon as I set self.layeredNavigationItem.leftBarButtonItem = .... in the viewDidLoad: of my view controller it seems to mess up the centered title and move it into an odd location. I tried setting up the bar button items in the configuration block but couldn't get the navigation bar to show the buttons then. The attached image shows what I am talking about. Am I missing something? Thanks
Twitter for iPad has a great feature where, if you pull the layers rightward far enough, they are removed from the view. I find this a very intuitive way to clean up the interface.
What would it take to implement the same thing for FRLayeredNavigationController? I can attempt to do it, but some guidance would be most helpful!
FRLayeredNavigationController should have a small abstraction layer, which abstracts from the screen's coordinate system. So, the axis and the direction of the axis in which to stack the layer (currently X-Axis in positive direction) should be configurable. After building that abstraction layer, FRLayeredNavigationController should easily support Left-to-Right (X-Axis, positive), Right-to-Left (X-Axis negative), Top-to-Bottom (Y-Axis, positive) and Bottom-to-Top (Y-Axis, negative) directions.
Especially Right-to-Left is interesting for bidirectional and RTL languages, such as arabic.
The code quality of FRLayeredNavigationController should profit of this abstraction, too.
The implementation should not be too hard, I think. There has already been an issue asking about RTL stacking.
I want the Naviagtion Controller to treat swiping a layer off the screen as a pop. Is this possible ?
I would like to be able to set percentages so that when the view is rotated they always fill x % of the screen. Can I do this now ?
example code to reproduce problem.
_labelPrompt = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 160, 22)];
_labelPrompt.backgroundColor = [UIColor clearColor];
_labelPrompt.numberOfLines = 1;
_labelPrompt.font = [UIFont boldSystemFontOfSize: 14.0f];
_labelPrompt.shadowColor = [UIColor colorWithWhite:0.0 alpha:0.5];
_labelPrompt.textAlignment = UITextAlignmentCenter;
_labelPrompt.textColor = [UIColor whiteColor];
_labelPrompt.adjustsFontSizeToFitWidth = YES;
_labelTitle = [[UILabel alloc] initWithFrame:CGRectMake(0, 22, 160, 22)];
_labelTitle.backgroundColor = [UIColor clearColor];
_labelTitle.numberOfLines = 1;
_labelTitle.font = [UIFont boldSystemFontOfSize: 14.0f];
_labelTitle.shadowColor = [UIColor colorWithWhite:0.0 alpha:0.5];
_labelTitle.textAlignment = UITextAlignmentCenter;
_labelTitle.textColor = [UIColor whiteColor];
UIView* titleView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 160, 44)];
[titleView addSubview:_labelPrompt];
[titleView addSubview:_labelTitle];
_labelPrompt.text = @"prompt";
_labelTitle.text = @"title";
if (UI_USER_INTERFACE_IDIOM()== UIUserInterfaceIdiomPad) {
self.layeredNavigationItem.rightBarButtonItem = _buttonHistory;
self.layeredNavigationItem.titleView = titleView;
} else {
self.navigationItem.rightBarButtonItem = _buttonHistory;
self.navigationItem.titleView = titleView;
}
When you go into edit mode on a tableview and try to drag a cell the drag get cancelled. I see the gesture recognizer is disabled for sliders, was wondering if theres any way to do similar for tableviews in editmode?
At the moment, FRLayeredNavigationController supports only one explicit stacking point (configured via the initialViewPosition property of FRLayeredNavigationItem). In addition, there is an implicit stacking point at the right margin of each layer.
It would be great if each layer could have several explicit stacking points. Each stacking point would have an additional priority which specifies the ordering of stacking. Let me explain via an example:
+--------------+ +-----------+ +-------------+
| | | xxxxx | | zzzzzzzz |
| | | xxxxx | | zzzzzzzz |
+--------------+ +-----------+ +-------------+
A B C D
The stacking points A, B, C and D have the following priorities:
A: 1
B: 3
C: 2
D: 4
If the frame now becomes smaller, FRLayeredNavigationController first moves the right-most layer to stacking point D. If after this, the layers do not fit into the new frame, the controller moves the middle layer to stacking poing B. If there is still need for more space, the left-most layer is moved to C. If there is still need for more space, the middle layer is moved to A. You see, layers are moved to stacking points in descending order of priorities.
What do you think? I'm willing to implement this feature but would like to ask for feedback first.
Hello again,
Do you have a solution to make the selected layer to become the root one (like in twitter).
I found a way to temporarly make it possible in modifying the property "initialViewPosition" to readwrite.
Here is what I do:
(void)tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[aTableView deselectRowAtIndexPath:indexPath animated:YES];
self.layeredNavigationItem.initialViewPosition = CGPointMake(0, 0);
RangeViewController *rangeViewController = [[RangeViewController alloc] initWithNibName:@"RangeViewController" bundle:nil];
[self.layeredNavigationController pushViewController:rangeViewController inFrontOf:self maximumWidth:YES animated:YES configuration:^(FRLayeredNavigationItem *item) {
item.nextItemDistance = 64;
item.hasChrome = NO;
return;
}];
[rangeViewController release];
}
The problem is that modifying this property make the layer to be anchored to point 0. Is there a better way to to this ?
Thanks for help :)
When trying to re-order a UITableViewCell the user is able to drag it a few pixels before the cells position gets reset, presumably the pan gesture?
How I could initialize FRLayeredNavigationController out of "AppDelegate"?
My first view (defined at Delegate) don't use stacked layout (provided by FRLayeredNavigationController), but another.
On examples I saw it being defined at application:didFinishLaunchingWithOptions: , through self.window.rootViewController (accessible only at 'AppDelegate').
On iOS 7 the layered nav controllers need offsetting below the status bar. The status bar colour is ignored? (shows black on my project)
The gradient in the chrome view looks so iOS 6 :)
In certain cases pushing an new viewController onto the stack crashes with following error:
*** Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency', reason: 'child view controller:<MainSettingsViewController: 0xf3696b0> should have parent view controller:<FRLayerController: 0x9e36270> but requested parent is:<FRLayerController: 0x9e38ed0>'
This happens mostly when switching viewControllers very quickly.
Is this a known problem ? is there any way to solve this ?
To enable the Right Sliders to support languages like Arabic
The idea is to decouple the layer placement (and re-placement) strategy from core FRLayeredNavigationController. This would allow the implementation of e.g. of dynamic placing strategies like
The work to do would be:
The prerequisites would be (and therefore best implemented along with Issue #5 and Issue #13):
Hey!
I have tried everything... but I can't delete the navigation bar of my view. I have tried:
(void)viewDidLoad
{
[super viewDidLoad];
self.title = @"Title";
self.navigationController.navigationBar.hidden = YES;
self.layeredNavigationController.navigationController.navigationBar.hidden = YES;
}
And the Title keeps appearing. Any ideas?!
Thanks!
need to lower the whole thing by the statusbar height on ios7
Hi guys,
This feels like a newbie question :)
There's been some useful commits recently but xcode is just not seeing any of the new methods (ie, compressViewControllers:YES)
I've done the usual stuff like cleaning my project, derived data is supposedly empty.
I'm inclined to think it's an xcode bug but FRNav is the only thing affected by it, hence asking the question here.
Thank you :)
Hello, first of all, thanks for the job done, this solution seems to be the easiest one to use for twitter like apps.
Do you have a solution to use the LayeredNavigationController as a subview?
Here is what I try to do with no sucess, am I doing it wrong ? :
InfoCategoriesViewController *icvc = [[InfoCategoriesViewController alloc] init];
FRLayeredNavigationController *lnc = [[FRLayeredNavigationController alloc] initWithRootViewController:icvc configuration:^(FRLayeredNavigationItem *item) {
item.width = 50;
item.nextItemDistance = 50;
}];
[self.contentView addSubview:lnc.view];
First, thanks for a great library! I love it :)
That being said, there are some things that make me think that it isn't yet implemented: the property is being @synthesize
'd in FRLayeredNavigationItem.m
, which differs from the other getters and setters (e.g. leftBarButtonItem
), which are implemented manually. Also, in FRLayerChromeView.m
, in manageToolbar
, there is no reference to titleView
.
Also, when I set the property nothing happens :/
Thank you in advance.
configuration:^(FRLayeredNavigationItem *item) {
item.width = 200;
item.nextItemDistance = -300;
}];
hi~,I want push a ViewController (the ViewController left bounds is left to its ParentViewController)
I try set
item.nextIitemDistance = - 300;
but not working,How can I do?
Hello.
I'm trying to find the best way to some custom subviews to the chrome view. I want to add two right bar button items and a label aligned left. Right now I'm just using self.layeredNavigationController.view addSubview:
which works, but those subviews are completely independent of the presented view (as it would I suppose). That is to say, if the view moves, those subviews don't move with it.
What would be the best way to add two right bar button items and alight a label to the left side of the view? I hope I provided enough info.
Thanks
Just wondering if this is something that is planned? And, if not, might this be considered as a feature request?
really great library you've got here
I was struggling to set the background of a grouped tableview to clear and noticed that the same code works when a FRLayeredNavigationItem hasChrome is set to NO.
If hasChrome is set to YES then the tableviews background is grey
in my tablewviews viewdidload:
[super viewDidLoad];
[self.tableView setBackgroundView:nil];
is there a quick fix for this please?
I'd like to set the iOS 7 translucent top bar but I don't see how. Is there a way to achieve this?
Note: As a workaround, I managed to achieve this by pushing my controllers inside a UINavigationController.
I've written a couple of tweaks that I'm using in the chrome view
You may or may not consider them feature requests and formalise them into your project.
One is for tintcolor and the other is for multiline title support which I needed, the gist is below.
Hi What is "areViewControllersMaximallyCompressed" mean?
thank you!
The current version there (0.3.0) is super old and doesn't match the documentation at all.
Can I change the default position of the main view from the left to right ?
FRLayeredNavigationController does not work well as master view controller in master-detail application (UISplitviewController), as shown in this screenshot http://imageshack.us/photo/my-images/543/photosl.png/
This could be improved by implementing a minimum width for child view controllers. If pushing new view controller would leave the new controller less room than what the minimum width is, all the view controllers on the stack would be moved left. In other words, instead of showing a constant width slice of each view controller in the stack, this the width of these slices should dynamically adjust to make room for more controllers.
Hi,
I've just started implementing your controller system and I must say I've been really impressed with the way you've done things! Also it's not in your list but the Wunderlist application also uses your framework.
I'm fairly new to coding and am struggling with getting a few things to work and was hoping you could help. I've integrated your system into my app which uses the storyboard to layout all the menus.
Essentially I have a root view controller (uitableview) and a tab view controller which controls the rest of the app, I have successfully got the transition working correctly so I can pull the tab controller to the right to reveal the uitableview controller.
However there are a few things that, for the life of me, I can't figure out how to get working.
However I want to be able to slide the view to reveal (in the same way the user does by moving their finger) by the press of a button, using the popToRootViewControllerAnimated works but it only slides the menu downwards and you can't get back by a finger slide.
Is this possible (it's done in the wunderlist application that your framework is used in)?
Is this possible? Again the wunderlist application uses this approach.
One last thing, my delegate methods don't seem to be firing, is there something specific i need in the delegate method code wise?
Sorry for all the questions but i hope you can help.
Many Thanks
Richard
When you try to temporarily disable swiping by calling:
self.layeredNavigationController.userInteractionEnabled = NO;
The swiping will not be recognized (as expected), but FRLayeredNavigationController's gesture recognizer is not fully removed.
In my application I need to disable swiping and display a transparent UIView that allows for freehand drawing. I was having issues while drawing because touchesCancelled was getting called unexpectedly on my transparent UIView, which prevented the user from drawing anything.
I was able to fix this by calling removeGestureRecognizer in FRLayeredNavigationController's detachGestureRecognizer method:
- (void)detachGestureRecognizer
{
[self.view removeGestureRecognizer:self.panGR];
[self.panGR removeTarget:self action:NULL];
self.panGR.delegate = nil;
self.panGR = nil;
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.