Igor Delovski Board Forum Index Igor Delovski Board
My Own Personal Slashdot!
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Toolbars & Navigation Bars

 
Post new topic   Reply to topic    Igor Delovski Board Forum Index -> Mac Cocoa
Mac Cocoa  
Author Message
delovski



Joined: 14 Jun 2006
Posts: 3523
Location: Zagreb

PostPosted: Mon May 04, 2009 9:34 am    Post subject: Toolbars & Navigation Bars Reply with quote

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
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3523
Location: Zagreb

PostPosted: Fri May 29, 2009 8:22 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3523
Location: Zagreb

PostPosted: Thu Dec 16, 2010 9:55 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3523
Location: Zagreb

PostPosted: Fri Jun 08, 2012 12:51 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3523
Location: Zagreb

PostPosted: Thu Jun 14, 2012 8:43 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3523
Location: Zagreb

PostPosted: Thu Jun 21, 2012 9:51 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3523
Location: Zagreb

PostPosted: Fri Sep 27, 2013 5:50 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3031
Location: Europe

PostPosted: Sun Oct 27, 2013 12:34 am    Post subject: Reply with quote

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
View user's profile Send private message
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3031
Location: Europe

PostPosted: Fri Apr 03, 2020 8:15 pm    Post subject: Reply with quote

Prevent Back Button Navigating to Previous Controller

"Sometimes you want to stop your user immediately going back to the previous
screen without prompting them first."


Get system navigation bar button back click event

"When we use the system navigation bar, sometimes when we need to return
directly from C --> A after our A page --> B page --> C page, we need to get
the click event."
Back to top
View user's profile Send private message
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3031
Location: Europe

PostPosted: Fri Jun 12, 2020 3:43 pm    Post subject: Reply with quote

so - In iOS13 the status bar background colour is different from the navigation bar in large text mode

"The key is defining the desired appearance and setting this value on BOTH
the nav bar's standardAppearance AND its scrollEdgeAppearance. I have the
following in the init for my base navigation controller subclass for my entire
app"
Back to top
View user's profile Send private message
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3031
Location: Europe

PostPosted: Fri Jun 12, 2020 3:45 pm    Post subject: Reply with quote

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
View user's profile Send private message
delovski



Joined: 14 Jun 2006
Posts: 3523
Location: Zagreb

PostPosted: Sat Jun 27, 2020 4:01 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3031
Location: Europe

PostPosted: Sun Jan 21, 2024 6:24 pm    Post subject: Reply with quote

so - iPhone viewWillAppear not firing

"Thanks iOS 13.

ViewWillDisappear, ViewDidDisappear, ViewWillAppear and ViewDidAppear
won't get called on a presenting view controller on iOS 13 which uses a new
modal presentation that doesn't cover the whole screen."


so - When using a UINavigationController the viewWillAppear or viewDidAppear methods of my controller are not called

"NOTE: this was written in 2013. Changes to the way iOS handles view
hierarchies nowadays may render this solution useless and/or dangerous.
So use at your own risk."
Back to top
View user's profile Send private message
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3031
Location: Europe

PostPosted: Mon Jan 22, 2024 5:02 pm    Post subject: Reply with quote

r - How to place a view in the UINavigationBar and increase its height

"You can see an expanded UINavigationBar with additional UIViews located
below the title in many native Apple applications."
Back to top
View user's profile Send private message
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3031
Location: Europe

PostPosted: Mon Jan 22, 2024 5:34 pm    Post subject: Reply with quote

so - Is there a way to change the height of a UINavigationBar in Storyboard without using a UINavigationController?

"You can change the nav bar height programmatically:

[navBar setFrame:CGRectMake(0, 0, 320, 64)];"
Back to top
View user's profile Send private message
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3031
Location: Europe

PostPosted: Mon Jan 22, 2024 5:46 pm    Post subject: Reply with quote

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
View user's profile Send private message
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3031
Location: Europe

PostPosted: Tue Jan 23, 2024 9:50 am    Post subject: Reply with quote

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 Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Igor Delovski Board Forum Index -> Mac Cocoa All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Delovski.hr
Powered by php-B.B. © 2001, 2005 php-B.B. Group