uinavigationbar

iOS 10 can no longer set barcolor and tint on MFMessageComposeViewController

廉价感情. 提交于 2019-12-02 22:18:37
Below code works on iOS version 9.x or less, for some reason this does not work if iOS 10 if([MFMessageComposeViewController canSendText]) { controller.body = message; NSString *tel = pContact.tlc; controller.recipients = pContact.tlc?@[tel]:nil; controller.messageComposeDelegate = self; controller.navigationBar.tintColor = [UIColor whiteColor]; controller.navigationBar.barTintColor = [UIColor blueColor]; [self presentViewController:controller animated:YES completion:nil]; } is it broken or did some thing change. Not sure whats missing here. I am in the dark (pitch black) EDIT: I tried to use

How to remove UINavigationBar inner shadow in iOS 7?

余生长醉 提交于 2019-12-02 22:18:28
Inner shadow example I'm trying to put nav bar below the other one to make it look like one tall nav bar. But in iOS 7 UINavigationBar now has inner shadow on top and on bottom of it. I really need to remove it. But I didn't found any solution. It looks like the shadow is prerendered, but in fact it slowly appears in about 0.4 second after the view appears. I've tried almost everything but the shadow is still there. I removed the horizontal line below the bar with this code: for (UIView *view in [[[self.navigationController.navigationBar subviews] objectAtIndex:0] subviews]) { if ([view

UISegmentedControl in the Navigation Bar with the Back button

霸气de小男生 提交于 2019-12-02 21:58:34
I'm adding a UISegmentedControl to the Navigation bar programatically where the titleView should be. But as Apple docs have mentioned under titleView , This property is ignored if leftBarButtonItem is not nil . But I want to have the back button as well. Like they have illustrated in their own images! Below is the code I add the UISegmentedControl . self.navigationItem.leftBarButtonItem = nil; UISegmentedControl *statFilter = [[UISegmentedControl alloc] initWithItems:[NSArray arrayWithObjects:@"Filter_Personnal", @"Filter_Department", @"Filter_Company", nil]; [statFilter

how can I add attached drop shadows to uinavigationbar and uitoolbar

风格不统一 提交于 2019-12-02 21:29:49
I'm working on an app that uses a custom image for UINavigationBar and UIToolbar, which is fine, but they also need a drop shadow below the nav bar and above the toolbar, which would always rest above all other view controllers. I cannot simply make background images which include the shadows as this would not work well with my tableviews. I also need the shadows animate away when I set nav bar and tool bar to hidden (animated). I've looked through Stack Overflow and other sources on the net, and have worked through the proposed solutions but I cannot successfully subclass UINavigationBar,

How to make a Navigation bar transparent and fade out like in the photo app in the iPhone

余生颓废 提交于 2019-12-02 21:10:32
i am new to iPhone Programming ...can anybody help me out please.. i want to develop an app like photo app in iPhone.. How to make the naveigation bar and toolbar transparent and fadeout like in photo app in iPhone Thank u .. UINavigationBar inherits from UIView , so you can use UIView 's animation methods to fade it out by setting the alpha property to 0. This should work: [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:0.5]; [navigationBar setAlpha:0.0]; [UIView commitAnimations]; Since I'm a block-using kinda guy, I use this little snippet. [UIView

What is the default color for navigation bar buttons on the iPhone?

萝らか妹 提交于 2019-12-02 21:10:17
I'm adding a segmented control to a navigation bar in my iPhone app. By default the color of the segmented control matches the color of the navigation bar. I want to match the color of the segmented control to other buttons in the navigation bar (like the back navigation button). Can anyone tell me an RGB value (or a system color) that matches the default color of UIButtonBarItems that have been added to a UINavigationBar with a style of UIBarStyleDefault? ceperry After a while, I realized that the iPhone was applying a blue gradient to the button, so the tint needed to be pretty gray. I

iOS11 customize navigation bar height

烂漫一生 提交于 2019-12-02 20:54:48
First of all, thank you for coming here and help solving my problem. Thank you!!! In iOS11 beta6, sizeThatFits: seems to not work on UINavigationBar. I notice that UINavigationBar structure has changed by Reveal my app. I have tried my best to change custom navigation bar's height. But it seems always to be 44 , and it works before iOS11. - (CGSize)sizeThatFits:(CGSize)size { CGSize newSize = CGSizeMake(self.frame.size.width, 64); return newSize; } Oddly, I just log its frame in didMoveToSuperview method, its height is 64, but I really see that is 44 in Reveal and app. I have no idea about

How to add UIView over navigation bar?

99封情书 提交于 2019-12-02 20:51:53
I need overlay UINavigationBar with UIView like here Is there a way to do this except using custom UIView with button back as nav bar? You can add a subview to the base view of the Application [[[UIApplication sharedApplication] keyWindow] addSubview:vMyCustomUIView]; To make sure it is only shown when your view controller is visible you could add and remove it in the viewDidAppear and viewDidDisappear delegate methods. Here is an example that would show a blue box overlapping them. - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view from its nib.

Custom UINavigationController UINavigationBar

ぐ巨炮叔叔 提交于 2019-12-02 19:50:54
Basically I want a custom UINavigationBar . I don't want it to be "translucent" or anything, like the pictures app. I basically want to completely remove it, but I still want to be able to add back buttons and such when navigation controllers are pushed, and I want the views (EG: UITableViewController ) to be pushed down below it. Like this: Any ideas how to achieve this at all? Thanks Thomas Clayson @implementation UINavigationBar (background) - (void)drawRect:(CGRect)rect { UIImage *image = [UIImage imageNamed:@"navigationbar.png"]; [image drawInRect:CGRectMake(0, 0, self.frame.size.width,

Animate a UINavigationBar's barTintColor

强颜欢笑 提交于 2019-12-02 19:47:38
The app I'm working on changes the barTintColor of its navigation bar when pushing new view controllers. Right now we set that colour in the destination view controller's viewWillAppear: method, but we have a few issues with that. With the way we're doing this right now, the navigation bar's colour changes abruptly, while the rest of the bar content animates as usual. What I'd like is for the bar to fade between the source and destination colour. Is there any way to achieve this with public Cocoa Touch APIs? adamd23 You can add extra animations that match the timing and animation curve of the