uinavigationbar

Trouble applying gesture recognizer to navigationbar

与世无争的帅哥 提交于 2019-12-10 17:33:29
问题 In my iPad Application I have multiple views on a screen. What I want to do is apply a double tap Gesture Recognizer to the Navigation Bar. But I had no success, however when the same gesture recognizer applied to that view it works. Here is the code I am using: // Create gesture recognizer, notice the selector method UITapGestureRecognizer *oneFingerTwoTaps = [[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(oneFingerTwoTaps)] autorelease]; // Set required taps and number

Smooth scrolling with prefersLargeTitles and UITableView

拟墨画扇 提交于 2019-12-10 17:32:07
问题 I encountered a problem with the scrolling when using the prefersLargeTitles and added UITableView . If I set the prefersLargeTitles within a navigation controller and its root is a UITableViewController everything is fine, scrolling of the navigation large title works the same way we can see in the system apps (in iOS 11+) . The problem However, if I use a UIViewController and add a UITableView in it, scroll seems to act differently. Navigation bar is moving more/faster than I actually

setNavigationBarHidden animation not working as expected on iPhone X

柔情痞子 提交于 2019-12-10 17:08:14
问题 I have code that enters full screen mode by hiding the UINavigationController's navigation bar. I want a smooth animated zooming effect when entering full screen. I use setNavigationBarHidden(_:animated:). This has all worked fine up to now, even on iOS 11, but on iPhone X the animation is not working well. On hiding, there is no animation and the nav bar just disappears. On unhiding, it does animate but the nav bar appears at a slower rate than the navigation controller's content area

How i can use image in navigation bar title in swift ios

余生长醉 提交于 2019-12-10 13:54:37
问题 i'm in trouble. i want to use image in navigation bar title, but i'm getting a error i.e "UIImage" is not a subtype of "NSString". Below the code, look it. class Dashboard: UIViewController { override func viewDidLoad() { super.viewDidLoad() self.navigationItem.title = UIImage(named: "logo.png") // Do any additional setup after loading the view. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } } Anyone can suggest

How to remove UINavigationbar prompt programmatically?

醉酒当歌 提交于 2019-12-10 13:17:56
问题 I have a view controller, and I set the navigation bar with prompt in IB. But I want to remove the prompt and make the bar as "1 line" sometimes. how can I do it in code? 回答1: [[self navigationItem] setPrompt: nil]; This animates the removal of the prompt. 来源: https://stackoverflow.com/questions/7049608/how-to-remove-uinavigationbar-prompt-programmatically

iOS 7 backBarButtonItem hidden

两盒软妹~` 提交于 2019-12-10 13:14:32
问题 I've an issue with back bar button. It stay hidden no matter that i do like self.navigationItem.hidesBackButton Here is my code to add back button: // - (void)viewDidLoad{ [.....]; UIBarButtonItem *back = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"UI_BTN_BACK", nil) style:UIBarButtonItemStylePlain target:nil action:nil]; back.tintColor = [Templates getColor:@"color"]; [[self navigationItem] setBackBarButtonItem:back]; // Parent [super viewDidLoad]; } Button stay hidden BUT

Navigation Controller Back button to go to the screen before the previous screen

左心房为你撑大大i 提交于 2019-12-10 13:09:34
问题 I'm wondering whether it's possible to go back to 2 previous page using navigation controller button. Right now, I've custom made the button using this code self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:mainLib.navCountryTitle style:UIBarButtonItemStyleBordered target:self action:@selector(handleBack:)]; And on 'handleback' method, I called this line [self.navigationController popViewControllerAnimated:YES]; So in this case it will go to the previous screen.

How can I add multiple UIBarButtonItem's to a UINavigationBar?

允我心安 提交于 2019-12-10 12:56:55
问题 I want to add many UIBarButtonItem 's to a UINavigationbar , not just right and left buttons: logoButton = [[UIBarButtonItem alloc] initWithTitle:@"A Button" style:UIBarButtonItemStyleBordered target:self action:@selector(logoButtonAClicked:)]; logoButton2 = [[UIBarButtonItem alloc] initWithTitle:@"B Button" style:UIBarButtonItemStyleBordered target:self action:@selector(logoButtonBClicked:)]; logoButto3 = [[UIBarButtonItem alloc] initWithTitle:@"C Button" style:UIBarButtonItemStyleBordered

Making uibarbuttonitems fade

别等时光非礼了梦想. 提交于 2019-12-10 12:39:14
问题 I have a navigation bar that is set up and controlled completely with code. So it does not show up in IB. I have a button appear by "self.navigationitem.rightbarbutton = myButton;" An I make it go away by setting it equal to NIL. What I am wondering is how could I make it fade in and out? 回答1: I found what worked best for me [self.navigationItem setRightBarButtonItem:myButton animated:YES]; And then [self.navigationItem setRightBarButtonItem:nil animated:YES]; To make it fade out. 回答2: Swift

SplitViewController detailViewComtroller's NavigationBar color changes to pink grayish

泪湿孤枕 提交于 2019-12-10 12:34:35
问题 When i change detailViewcontroller in splitviewcontroller its navigation bar color changes to Pinkish gray color. Not able to understand why happening this. Please help... 回答1: If you customise your navigation bar then your view will disappear into set your main view (parent) view color -(void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; //Set Your color of navigation bar. } -(void)viewWillDisappear:(BOOL)animated{ [super viewWillDisappear:animated]; //Set your color of