uitoolbar

how to show value on button of toolbar in objective-c?

烈酒焚心 提交于 2019-12-13 21:24:56
问题 I am doing project of bill. there are many bills that i can scroll and each bill have many items with quantity and price. At the button, there are also many buttons on toolbar. Total Price of bill is 1 button among them, and i don't know how to show the number of total price on this button ! 回答1: A UIButton has a currentTitle-property and you should be able to get the title from that. A UIBarButtonItem has a possibleTitles-property which is an NSSet containing all possible titles the bar

Laying white toolbar over QLPreviewController toolbar is looking gray

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-13 18:01:07
问题 I stumbled upon this SO discussion on adding/removing qlpreviewcontroller's uibarbuttonitems. However they were removing the navigation bar and overlaying a new one on top of it. I was looking to change the toolbar primarily because the toolbar that comes with QLPreviewController is black and the rest of the toolbars in my application are white. I have code in place to get the bar overlaying but it seems that when I set the toolbar tint color to white, its actually becoming a light gray. I

How do I add buttons to a toolbar within an iPad popover?

家住魔仙堡 提交于 2019-12-13 17:16:55
问题 Hoping someone here has conquered this one 'cuz it's driving me crazy. My app includes a popover that is used to enter and edit information. I learned today that it's possible to show a toolbar at the bottom of the popover and that's great -- except that I cannot for the life of me get any buttons to show on said toolbar. Here's where we start: UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController: editorViewer]; //*** This makes the toolbar

Custom UINavigationController UIToolbar subclass

狂风中的少年 提交于 2019-12-13 15:48:57
问题 I need to work with a subclassed UIToolbar in the UINavigationController . I know this can be done via Interface Builder but I need it to be done programatically. The docs state that the UINavigationController toolbar property is readonly so I'm at a bit of a loss as to how I proceed. Related: Custom UINavigationController UIToolbar Background Image 回答1: A new init* method has been available since iOS 5 - (instancetype)initWithNavigationBarClass:(Class)navigationBarClass toolbarClass:(Class

iPhone toolbar for entire app

╄→尐↘猪︶ㄣ 提交于 2019-12-13 06:21:40
问题 I have my app base on navigationController . So i set the toolbar visible for some views and for others i didnt calling setToolbarHidden:NO or YES . first question, this goes in viewWillAppear method ? Then in my appDelegate , I put one item on the toolbar but is not being show. can someone show me how can I use delegate protocol here so each view know what to do when a item is pressed?? my code: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *

Why is my Toolbar getting chopped off in compact size?

强颜欢笑 提交于 2019-12-13 05:39:09
问题 As can be seen below, my toolbar gets chopped off in the compact size: My UI consists of a ToolBar and a WebView. The constraints I tried don't work, although I did get them to turn blue. As you can see, my toolbar is pinned to the top, the left side, and the right side (I also set a constant height). How can I get my toolbar to display correctly in the compact size. Thanks. Edit1: Edit2: Here is what I did to get things to display correctly: I had to drag the edges of the WebView all the way

Switching views from barbuttonitem? [duplicate]

醉酒当歌 提交于 2019-12-13 04:43:32
问题 This question already has an answer here : Creating nib view from UIBarButtonItem? (1 answer) Closed 5 years ago . So I've seen previous questions similar to this but they were of no help. I've read Apple's documentation too but I could not understand where I've gone wrong. AFAIK I did everything logically, but when I click on my done button on an UItoolbar overlay, the button can be pushed but it does not do anything. This obviously means it fails to acknowledge the written code. But how? I

UIToolbar shows different color on ios 5.0 and ios 6.0 Simulators

99封情书 提交于 2019-12-13 04:10:11
问题 I have set tintcolor for my UIToolBar.It displays Correctly in ios 6.0 but it shows black color on ios 5.0 simulator. My code is here originalBounds = mysearchBarBarItem.customView.bounds; mySearchBar.bounds = CGRectMake(0,0,215,44); myTopToolbar.tintColor = [UIColor colorWithPatternImage:[UIImage imageNamed:NAVIGATION_BAR_BACKGROUND]]; myTopToolbar.barStyle = UIBarStyleDefault; mySearchBar.barStyle = UIBarStyleDefault; mySearchBar.tintColor = [UIColor colorWithPatternImage:[UIImage

Subclassing UIToolbar and overriding drawRect: - UIBarButtonItems NOT displaying

ぃ、小莉子 提交于 2019-12-13 03:09:01
问题 Context I'm using the 'initWithNavigationBarClass' method to initialize a UINavigationController with a custom toolbar, here is the line where I alloc init the UINavigationController navigationController = [[UINavigationController alloc] initWithNavigationBarClass:nil toolbarClass:[QuestionToolbar class]]; Is the class, "QuestionToolbar", I subclass UIToolbar and override drawrect, here is the drawRect method: - (void)drawRect:(CGRect)rect { [super drawRect:rect]; UIImage *backgroundImage =

How can I add a UIToolbar to a UIViewController?

落爺英雄遲暮 提交于 2019-12-12 16:03:01
问题 I have a UIViewController. I want to add a UIToolbar to the bottom, but IB is not letting me. How can I achieve this? Note: The UIViewController is part of a UINavigationController. I'm not sure if this affects the visibility of the toolbar. 回答1: Starting from iOS 3.0 you can set toolbar items you want using following UIViewController 's method: - (void)setToolbarItems:(NSArray *)toolbarItems animated:(BOOL)animated of simply set or override toolbarItems property. And toolbar will appear