Mac Cocoa |
Author |
Message |
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Mon May 04, 2009 9:34 am Post subject: Toolbars & Navigation Bars |
|
|
MF - UIToolbar at the same time as a UINavigationController with a
UITableView
"You can either just make sure to do [myView addSubview:myToolbar] after
[myView addSubview:myTableView] which will add the toolbar layer on top
of the table view, or you can ensure that its on top with something like [my-
View insertSubview:myToolbar aboveSubview:myTableView] to replace the
toolbar addSubview."
Last edited by delovski on Fri Sep 27, 2013 5:49 pm; edited 1 time in total |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Fri May 29, 2009 8:22 pm Post subject: |
|
|
iphonesdkarticles.com - Navigation Controller + UIToolbar
"In this tutorial we will learn how to add a UIToolbar to an app with UINavi-
gationController. I had a requirement where I wanted to add a UIToolbar with
one button." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Thu Dec 16, 2010 9:55 am Post subject: |
|
|
MF - Add UITextField and FixedSpace programatically to toolbar
"If you had looked at the possible choices for style: in your call to initWith-
Title:style:target:action:, you'd see that UIBarButtonSystemItemFixedSpace
is not a valid choice." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Fri Jun 08, 2012 12:51 pm Post subject: |
|
|
so - How to add background image on iphone Navigation bar?
Code: | @implementation UINavigationBar (CustomImage)
- (void)drawRect:(CGRect)rect {
UIImage *image = [UIImage imageNamed:@"NavigationBar.png"];
[image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
}
@end |
"As of iOS 5, there is an official way to do this. (see iOS Developer Library)" |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Thu Jun 14, 2012 8:43 pm Post subject: |
|
|
so - How to add search bar in navigation bar for iphone?
"Add the search bar as title view to the navigation bar. This code example
also includes a fix for the extra padding you get by adding it as a title view." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Thu Jun 21, 2012 9:51 pm Post subject: |
|
|
accella.net - Custom UINavigationBar with iOS 5
"BUT… what happens if you don’t upgrade to iOS 5? Anyone running iOS 5
with an old iOS 4.x app is going to be very disappointed. Most of the old
methods of getting custom appearances are completely overridden by the
new UIAppearance Protocol. Even overriding the -(void)drawRect: method
I put above is ignored in favor of the new stuff." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Fri Sep 27, 2013 5:50 pm Post subject: |
|
|
reddit - Old Style Navigation Push Animation for iOS7
"This class implements the UIViewControllerAnimatedTransitioning protocol
and it lets you use the old style push and pop animation (before iOS7) in
which the two views scrolls together. Useful for UINavigationController with
a transparent background in which the views overlaps with the iOS7 anima-
tion style." |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3136 Location: Europe
|
Posted: Sun Oct 27, 2013 12:34 am Post subject: |
|
|
http://uxmag.com/articles/adapting-ui-to-ios-7-the-side-menu
Adapting UI to iOS 7: The Side Menu
Using an objective-C library we created named TWTSideMenuViewController (subsequently open sourced on Github), we solved the side menu animation problem by moving and scaling the main view down and away from the status bar. We also improved the scaled down view by thinking of the menu and the main view as a single view with both of them in the same visual plane. In other words, we changed the viewport to focus on different aspects of the application as if zooming in or out like the new iOS 7 app switcher.
Link on Github: TWTSideMenuViewController |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3136 Location: Europe
|
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3136 Location: Europe
|
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3136 Location: Europe
|
Posted: Fri Jun 12, 2020 3:45 pm Post subject: |
|
|
sarunw.com - UINavigationBar changes in iOS13
"In iOS13 the default appearance of the large title style navigation bar has
changed from translucent to transparent." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Sat Jun 27, 2020 4:01 pm Post subject: |
|
|
wwdc - Build with iOS pickers, menus and actions
"Build iPhone and iPad apps with fluid interfaces and easily-accessible
contextual information. We'll show you how to integrate the latest UIKit
controls into your app to best take advantage of menus, date pickers,
page controls, and segmented controllers. Learn how to adopt Menus
throughly your user interface, and explore how UIAction can help unify
your event handling. Once you've learned about these new controls,
watch 'Design with iOS pickers, menus and actions' to discover how to
design great interfaces with these tools and APIs." |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3136 Location: Europe
|
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3136 Location: Europe
|
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3136 Location: Europe
|
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3136 Location: Europe
|
Posted: Mon Jan 22, 2024 5:46 pm Post subject: |
|
|
sarunw.com - UINavigationBar changes in iOS13
"If you want translucent style back put following code in"
Code: | application(_:didFinishLaunchingWithOptions:).
let appearance = UINavigationBarAppearance()
appearance.configureWithDefaultBackground()
UINavigationBar.appearance().scrollEdgeAppearance = appearance |
Apple - TN3106: Customizing the appearance of UINavigationBar
"UINavigationBar in iOS 15 introduces changes to its appearance settings.
It extends the usage of its scrollEdgeAppearance, which by default produces
a transparent background, to all navigation bar styles." |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3136 Location: Europe
|
Posted: Tue Jan 23, 2024 9:50 am Post subject: |
|
|
adc - rootViewController
"If the window has an existing view hierarchy, the old views are removed
before the new ones are installed."
This tidbit wasted my whole day.
It used to work ok if I set the root view controller after adding a navigation
or tab controller as a subview to a main window up until transition from iOS
12 to iOS 13 but then my apps stopped receiving -viewWillAppear: and
viewDidAppear: on -pushViewController:animated: or when the view popped
back.
As I was trying to resurrect an older project nothing seemed to work. All the
views were messed up, especially on bezel-less phones like iPhone X and
newer.
Googling found that people don't have these called for various reasons even
before iOS 13 but nothing helped. Then at some point I changed this code:
Code: | [self.window addSubview:self.navController.view];
[self.window makeKeyAndVisible];
[self.window setRootViewController:self.navController]; // TOO LATE
|
to this:
Code: | [self.window setRootViewController:self.navController];
[self.window addSubview:self.navController.view];
[self.window makeKeyAndVisible];
|
The reason I did that was not because I realised that setting a root view
controller will have the old views [...] removed before the new ones
are installed.
No. I was getting this warning in the console: "Unbalanced calls to begin/end
appearance transitions for <UINavigationController...>" even after I removed
everything from the view, like commenting out all the cone in -viewDidLoad.
It was driving me crazy and I moved the call to -setRootViewController: in
an attempt to silence this warning. And when I did it everything started to
behave as it should. It was like magic, or iOS 12 |
|
Back to top |
|
|
|