uinavigationbar

Android ActionBar pattern - multiple activities or fragments

时光毁灭记忆、已成空白 提交于 2020-01-13 06:04:18
问题 There are few similar questions on stackoverlow, but I haven't find clear explanation at any of the answers how to implement Action Bar pattern for more complex/multiple activities apps. As I understand, there are two options to do this: 1.) implement multiple activities and in each of them implement/include action bar --> problem with this is that when ever you lunch new activity, although it has the same looking action bar, it has that transition, and jumps through the screen, so it's

UINavigationBar with solid color iOS 5

此生再无相见时 提交于 2020-01-13 05:13:45
问题 I'm using the category to customize nav bar. My code is: - (void) drawRect:(CGRect)rect { CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetFillColor(context, CGColorGetComponents([self.tintColor CGColor])); CGContextFillRect(context, rect); } It works well, but not in iOS 5. I need nav bar color to be solid without any gradient. How should I do this? As I know, for iOS 5 the only way to replace drawRect method is to make a subclass, but is there any way to make all navigation

How to correctly set UINavigationBar height in iOS 11

和自甴很熟 提交于 2020-01-12 09:19:11
问题 In my iOS 9+ app I use UINavigationBar in some of the UIViewController s "manually" (= placing them directly in the VC instead of using UINavigationViewController ). Setting a height for such a UINavigationBar using a simple contraint was no problem before. However in iOS 11 the bar itself still correctly uses the assigned size, but the content is not positioned correctly any more (is now alligned to the top). Any idea how to solve this? EDIT: I am pretty sure, that this is not a duplicate of

Transition Navigation Bar Title

白昼怎懂夜的黑 提交于 2020-01-12 05:23:07
问题 In an app called "Luvocracy" the title of the navigation bar is changed when the user swipes up on the screen. The old title is pushed up, while the new one is transitioned in. I don't have a video of it now, but here are some screen shots: https://www.dropbox.com/s/sns0bsxkdv7pw3l/Photo%20Apr%2008%2C%2011%2001%2005%20AM.png https://www.dropbox.com/s/ys9a49u3dyxrlcm/Photo%20Apr%2008%2C%2011%2001%2009%20AM.png https://www.dropbox.com/s/dlcfvfvqqov3ag7/Photo%20Apr%2008%2C%2011%2001%2013%20AM

Transition Navigation Bar Title

不想你离开。 提交于 2020-01-12 05:23:01
问题 In an app called "Luvocracy" the title of the navigation bar is changed when the user swipes up on the screen. The old title is pushed up, while the new one is transitioned in. I don't have a video of it now, but here are some screen shots: https://www.dropbox.com/s/sns0bsxkdv7pw3l/Photo%20Apr%2008%2C%2011%2001%2005%20AM.png https://www.dropbox.com/s/ys9a49u3dyxrlcm/Photo%20Apr%2008%2C%2011%2001%2009%20AM.png https://www.dropbox.com/s/dlcfvfvqqov3ag7/Photo%20Apr%2008%2C%2011%2001%2013%20AM

How to create Custom Navigation Bar like BestBuy App?

笑着哭i 提交于 2020-01-12 03:57:09
问题 I want to make a custom navigation bar as like in the BestBuy App or like shown in the below given screenshot. I want this type of Navigation to be always on the top of each and every viewController. If anyone can tell me the procedure or any kind of help would be appreciated. Thanks. 回答1: write a subclass of UINavigationBar in which you do custom drawing and add subviews as needed. then tell your navigationController to use that class by initing it using initWithNavigationBarClass

How to customize navigation bar title font and size in UINavigationBar?

谁说胖子不能爱 提交于 2020-01-11 12:16:29
问题 I want to customize only a specific part of the navigation bar title. For example, "Navigation Bar Title." I made this sentence a title. In the case of "Navigation", apply blue color and system bold font, For "Bar Title." I want to apply red color and system regular fonts. How is it possible? 回答1: You should use a UILabel with an attributed title as a custom title view for your navigation bar. let titleLabel = UILabel() //attributes for the first part of the string let firstAttr:

Restore default navigation bar appearance

大憨熊 提交于 2020-01-11 08:28:23
问题 I'm making an iOS app for iPhone, and I'm using a navigation controller. At some point during the navigation, I'm adding a UISegmentedControl to a view controller, just under the navigation bar from the navigation controller. I'm inserting new background and shadow images in the navigation bar, to make the UISegmentedControl appear as part of the navigation bar. I do it like this: // nav bar color image let rect = CGRectMake(0, 0, view.frame.width, 0.5) // Used in navBar, size dosn't matter

Using UIAppearance to change label height

我们两清 提交于 2020-01-11 06:53:05
问题 Is there any way to use UIAppearance to change the height of a label inside of a UINavigationBar. Here's the code and an image of what's going on so you can understand what the problem is. [[UINavigationBar appearance] setTitleVerticalPositionAdjustment:-5.0 forBarMetrics:UIBarMetricsDefault]; [[UINavigationBar appearance] setTitleVerticalPositionAdjustment:-5.0 forBarMetrics:UIBarMetricsLandscapePhone]; NSDictionary *textAttributes = [NSDictionary dictionaryWithObjects:[NSArray

Change destination of Navigation Back button

♀尐吖头ヾ 提交于 2020-01-11 04:55:28
问题 How can I change the view controller the default navigation back button takes me to? The back button usually takes you back to the previous view controller. But what if I want it to go back by two view controllers? I mean I want to change the view controller the back button takes me to. I do not prefer creating a custom back button. So is there any other way? Probably an unwind segue linked to the back button or something? 回答1: Probably easiest way to achieve behaviour you want is to use