rightbarbuttonitem

swift how to divide tableview into sections with add to cart working properly?

狂风中的少年 提交于 2021-02-05 11:22:48
问题 This has got me in a crazy-spin. I’ve been ruminating over this for quite some time, have tried every trick of the trade, but with no luck.. I will be greatly indebted if you solve my problem. My issue is that when I divide ProductViewController into sections:- i)The cells i.e. images are not in correct order. ii) Add to cart button does not function properly. Note: - If the following code seems extensive to you, leave the rest of the code, just ook at the ProductViewController - I just want

Change the color of a bar button in iOS 7

强颜欢笑 提交于 2019-12-21 22:43:25
问题 I have the following code in my viewDidLoad of my containing view: // Now add the next button UIBarButtonItem *nextButton = [[UIBarButtonItem alloc] initWithTitle:@"Next" style:UIBarButtonItemStylePlain target:self action:@selector(self)]; self.navigationItem.rightBarButtonItem.tintColor = [UIColor blueColor]; self.navigationItem.rightBarButtonItem = nextButton; The UINavigationController parent has this in viewDidLoad: [super viewDidLoad]; // Do any additional setup after loading the view.

Custom rightBarButtonItem disappearing

半城伤御伤魂 提交于 2019-12-20 06:37:23
问题 I have a strange bug with a custom rightBarButtomItem in the NavBar. I have a TabBar application. If the app is loaded the button shows up correct. If i click through the tabs the button keeps showing. If i go back to one of the tabs which was already shown the button disappears. At the end the button only shows randomly in one of the tabs. My code works perfectly if i set a standard rightBarButtomItem programatically. But not with custom graphics. If a ChildViewController is pushed and

How to hide share button in QLPreviewController using swift?

牧云@^-^@ 提交于 2019-12-19 09:57:54
问题 I'm using the below code to use QLPreviewcontroller to show some documents in my app, let ql = QLPreviewController() ql.dataSource = self //ql.navigationItem.rightBarButtonItems = nil ql.navigationItem.rightBarButtonItem = nil presentViewController(ql, animated: true, completion: nil) I don't want the share button in the right top of QLPreviewcontroller. I'd tried setting rightBarButtonItem to nil, but it's not working. How can I hide that? 回答1: None of those solutions worked for me in Swift

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

iPhone flip right button (like iTunes)

冷暖自知 提交于 2019-12-09 12:55:42
问题 I'm trying to flip between two views. That's easy, the code is below, but I also want to simultaneously flip the button used to perform the flip. You can see this behavior in the iPod application when you're playing a track; tapping the flip button flips between the cover art and the track listing, but it flips the button at the same time. This is a page on the navigation controller, and the button I want to flip is the rightBarButtonItem . Here's the code I have so far. This flips the view,

custom right bar button item in ios6 is not transparent

三世轮回 提交于 2019-12-06 11:32:04
问题 i am creating a custom right bar button item for my navbar using the following code : // create a toolbar UIToolbar* tools = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 50, 44.01)]; // create the array to hold the button, which then gets added to the toolbar NSMutableArray* buttons = [[NSMutableArray alloc] initWithCapacity:1]; // create a toolbar item with image NSString* pathToSettingsResourceFile = [[NSBundle mainBundle] pathForResource:@"19-gear" ofType:@"png"]; UIImage*

Hide the rightBarButtonItem of a navigation controller

Deadly 提交于 2019-12-05 13:11:56
问题 Does anyone know how to hide a rightBarButtonItem of a UINavigationController ? In my application, I have an edit button as a rightBarButtonItem of a UINavigationController . I want to hide this ? UIBarButton` when some operations are done. 回答1: To Hide the right button: self.navigationItem.rightBarButtonItem = nil; Now, to show it: If you setup the right button in your view controller by assigning it to self.editButtonItem then simply assign it again in order to show it: self.navigationItem

Change the color of a bar button in iOS 7

不打扰是莪最后的温柔 提交于 2019-12-04 19:40:46
I have the following code in my viewDidLoad of my containing view: // Now add the next button UIBarButtonItem *nextButton = [[UIBarButtonItem alloc] initWithTitle:@"Next" style:UIBarButtonItemStylePlain target:self action:@selector(self)]; self.navigationItem.rightBarButtonItem.tintColor = [UIColor blueColor]; self.navigationItem.rightBarButtonItem = nextButton; The UINavigationController parent has this in viewDidLoad: [super viewDidLoad]; // Do any additional setup after loading the view. self.navigationBar.tintColor = [UIColor whiteColor]; self.navigationBar.barTintColor = [UIColor

custom right bar button item in ios6 is not transparent

这一生的挚爱 提交于 2019-12-04 17:49:49
i am creating a custom right bar button item for my navbar using the following code : // create a toolbar UIToolbar* tools = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 50, 44.01)]; // create the array to hold the button, which then gets added to the toolbar NSMutableArray* buttons = [[NSMutableArray alloc] initWithCapacity:1]; // create a toolbar item with image NSString* pathToSettingsResourceFile = [[NSBundle mainBundle] pathForResource:@"19-gear" ofType:@"png"]; UIImage* settingsImage = [[[UIImage alloc] initWithContentsOfFile:pathToSettingsResourceFile] autorelease]; settings = [