uibarbuttonitem

UISlider in UIBarButtonItem impacts animation behavior

為{幸葍}努か 提交于 2019-12-24 19:03:09
问题 In IB, I set a view MyView with an UIToolBar and I drop an UISlider on it. IB automatically embeds it in an UIBarButtonItem and sets its view with the UISlider. I display this MyView in a navigation controller with animation. UIViewController *myVC = [[UIViewController alloc] initWithNibName:@"MyView" bundle:nil]; [self.navigationController pushViewController:myVC animated:YES]; [myVC release]; MyView is displayed but without animation. Apart from that, everything works fine, I can use the

How do I remove UIBarButtonItem glow programmatically?

前提是你 提交于 2019-12-24 13:34:13
问题 Unfortunately there is no showsTouchWhenHighlighted for UIBarButtonItem and I can't edit my button from the toolbar... 回答1: The property responsible for this is accessible in the UIButton class: myButton.showsTouchWhenHighlighted = NO; You can access this (programmatically) in a UIBarButtonItem by assigning a UIButton to the bar button item's customView property, and configuring the button. You can do this in Interface Builder too: drag a UIButton onto a UIToolbar, and it will automatically

UIBarButtonItem not showing up on UIToolbar Swift

南笙酒味 提交于 2019-12-24 12:34:30
问题 I have a navigation controller with the toolbar enabled.I have a view controller with an MKMapView that is embedded in the navigation controller. When I run it in the simulator the toolbar shows up. However, when I try to add a UIBarButtonItem from code, the UIBarButtonItem doesn't show up on the toolbar. To add the button I have the following code in my viewDidAppear method: var trackingButton:MKUserTrackingBarButtonItem = MKUserTrackingBarButtonItem(mapView: self.theMapView) self

How did I get this with Interface Builder (and is it 'legal')

旧城冷巷雨未停 提交于 2019-12-24 10:05:03
问题 So here's a weird one. I've been doing a combination of interface builder and some direct editing of the .xib file and somewhere along the line I managed to produce a button (UIBarButtonItem) on the Toolbar that actually has a label BENEATH the button. Which I quite like, if only I knew how to get it consistently. Is this a standard thing that can be done with Interface Builder via some obscure methodology? Or is there a well-defined way to do it just by editing the .xib file? Note too that

How to add spacing to Left BarButtonItem Image with Swift 3

强颜欢笑 提交于 2019-12-24 09:57:44
问题 I would like to add space to the left of the bar button. So, I add this code. navbar.autoresizingMask = [.flexibleWidth, .flexibleBottomMargin, .flexibleRightMargin] navbar.delegate = self UINavigationBar.appearance().barTintColor = UIColor(red: 0.0/255.0, green:49.0/255.0, blue:79.0/255.0, alpha:0.1) UINavigationBar.appearance().tintColor = UIColor.white UINavigationBar.appearance().isTranslucent = true UINavigationBar.appearance().titleTextAttributes = [NSForegroundColorAttributeName :

Disappearing UIBarButtonItem images

情到浓时终转凉″ 提交于 2019-12-24 06:26:28
问题 I have an app that was recently released on the iOS App Store. The main screen of the app has two button bars. Each of the buttons has either an image or a text label. The interface was developed with the XCode Storyboard editor. One user sent me a screen shot that shows that all the image-based buttons have disappeared. We've determined that the buttons are functional -- tapping where the button should appear has the desired effect, so the button is effectively present but invisible. The

Prompting an UIAlertView to user before navigating back to the previous controller in a UINavigationController stack

跟風遠走 提交于 2019-12-24 04:28:10
问题 I'm trying to prompt a UIAlertView before navigating to the previous controller and preventing navigation if the user decides to stay on the same View Controller. Using CCTBackButtonActionHelper, the UIALertView can be easily generated but the only problem I'm facing is that it changes the color of the back button to gray just like any disabled UIBarButton control when clicked. However, clicking anywhere on the navigation bar restores its original color. So how could i prevent changing its

UIBarButton not changing

喜欢而已 提交于 2019-12-24 03:54:07
问题 @IBOutlet weak var playStopButton: UIBarButtonItem! var playStopArray = [UIBarButtonSystemItem.Pause, UIBarButtonSystemItem.Play] var index = 0 @IBOutlet weak var image: UIImageView! @IBAction func playButton(sender: UIBarButtonItem) { println("pressed") playStopButton = UIBarButtonItem(barButtonSystemItem: playStopArray[index], target: self, action: "startMusic:") println("here") if index == 0 { index = 1 } else { index = 0 } } func startMusic() { println("test") } I expected the bar button

Horizontally repositioning a UIBarButtonItem

不想你离开。 提交于 2019-12-24 02:42:48
问题 Is it possible to reposition a UIBarButtonItem that's in a UINavigationBar horizontally? I've seen the barButtonItem setBackgroundVerticalPositionAdjustment:forBarMetrics: method (but that's for vertical positioning), and I know how to do it if I make it a custom button, but how do I take a UIBarButtonItem with the style UIBarButtonItemStyleBordered and horizontally reposition it (that is, move it left or right)? Thanks in advance! 回答1: You can create a fixed size button as a 'filler' and add

Horizontally repositioning a UIBarButtonItem

天涯浪子 提交于 2019-12-24 02:42:22
问题 Is it possible to reposition a UIBarButtonItem that's in a UINavigationBar horizontally? I've seen the barButtonItem setBackgroundVerticalPositionAdjustment:forBarMetrics: method (but that's for vertical positioning), and I know how to do it if I make it a custom button, but how do I take a UIBarButtonItem with the style UIBarButtonItemStyleBordered and horizontally reposition it (that is, move it left or right)? Thanks in advance! 回答1: You can create a fixed size button as a 'filler' and add