uitoolbar

Auto Layout iOS 11 Toolbar UIBarButtonItem with customView

谁说胖子不能爱 提交于 2019-12-04 15:52:39
Recently in our project there was a problem with a UIBarButtonItem that was using a customView. Before iOS 11 we did the layout via flexible spacing items. This didn't work anymore and so nothing was displayed. Because I didn't find an answer here on SO that really solved the issue for me, I looked into it and came up with a (admittedly kind of hacky) solution I wanted to share with you. Maybe it can help you or you have some feedback. This is mixed objc and swift code, hope you don't mind. As shown in the WWDC Video Updating Your App for iOS 11 : "And so now in iOS 11, UI toolbar and UI

iOS5 changing Background of UIToolbar

非 Y 不嫁゛ 提交于 2019-12-04 15:30:01
I've read the "What's new in iOS 5" documentation and there it is stated, that changing the background of some UI-Elements is now better supported. I couldn't find the correct way for iOS 5 to change the background image of an UIToolbar. Is there a special new iOS 5 way of doing this? Or do i still have to subclass the UIToolbar? Yes, there is a new way to do this. You can use appearance to make all UIToolBar s have the same appearance. First, you have to make sure your class follows the UIAppearanceContainer protocol. Here I have done it in my app delegate: @interface AppDelegate :

How to implement newsfeed comment page similar to Facebook or Instagram

痞子三分冷 提交于 2019-12-04 14:57:16
Both Instagram and Facebook allow their users to comment on news feeds. In the comment scene, they basically have a UITableView with all the comments and a “footer” where user may enter comments and post them. So the “footer” is a UIView or UIToolBar with a UITextField/UITextView and a UIButton. Truly simple stuff from the look of it. Well I have been trying to implement it and the keyboard is not cooperating. I need the keyboard to not hide the “footer”. Especially now in iOS 8 the keyboard comes with a suggestions tool bar that a user may choose to show or hide. All these interactions make

Color of UIToolbar not changing

有些话、适合烂在心里 提交于 2019-12-04 08:23:59
I have created a UIToolbar. I am trying to give it black color using: toolbar.barStyle = UIBarStyleBlackOpaque; or toolbar's background property. But its color does not change in either case. How can I change it? Have you tried setting the tint property on UIToolbar? ie: - (void)viewDidLoad { [super viewDidLoad]; UIToolbar *toolbar=[[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 320, 46)]; toolbar.tintColor=[UIColor redColor]; [self.view addSubview:toolbar]; [toolbar release]; } Detailed in the apple docs IN iOS 7 you need to set the barTintColor Property- UIToolbar *doneToolbar=[[UIToolbar

Custom UINavigationController UIToolbar Background Image

瘦欲@ 提交于 2019-12-04 07:38:37
问题 I have an iPhone application using UINavigationController and would like to customize the elements with custom background images. I was able to do this for the UINavigationController's UINavigationBar pretty easily using Objective-C categories as below: http://foobarpig.com/iphone/uinavigationbar-with-solid-color-or-image-background.html I'd like to do the same for the UINavigationController's UIToolbar , but the same approach doesn't seem to work (although I have absolutely no idea why not.)

UIBarButtonItem not reacting after click

拥有回忆 提交于 2019-12-04 05:57:51
问题 From the rootViewController I navigate to a UIViewController if (self.contr == nil) { ExampleViewController *controller = [[ExampleViewController alloc] initWithNibName:@"Example" bundle:[NSBundle mainBundle]]; self.contr = controller; [controller release]; } [self.navigationController presentModalViewController:self.contr animated:YES]; In the UIViewController I have the method -(IBAction) goBack:(id)sender { [self.navigationController dismissModalViewControllerAnimated:YES]; } I added the

programmatically stop uipickerview animation on iphone

梦想与她 提交于 2019-12-04 05:19:31
I have a UIActionSheet containing a picker and a UIToolbar. On the UIToolBar there is a save button. However, some of my users reported pressing the save button before the UIPickerView stops spinning thus only retrieving the initial value (before spinning). Is there a way to get the currently selected item of the UIPickerView once the user taps save or get feedback of the active selected item while it's spinning? Thanks Even if they dismiss the picker while it's still spinning, the picker will still call the delegate with the final selected row once it stops, even if it isn't visible. Assuming

UISegmentedControl, UIToolbar and UINavigationItem

时间秒杀一切 提交于 2019-12-04 01:18:34
I've create a UISegmentedControl and successfully attached it to my navigationItem.tableView. But when I try instead to attach it to a UIToolbar, it blows up. I'm sure I've seen UISegementedControls on toolbars before - but can't seem to get it working. Thoughts? // works NSArray *statusItems = [[NSArray alloc] initWithObjects:@"one", @"two", nil]; statusSegments_ = [[UISegmentedControl alloc] initWithItems:statusItems]; self.navigationItem.titleView = statusSegments_; // doesn't work NSArray *statusItems = [[NSArray alloc] initWithObjects:@"one", @"two", nil]; statusSegments_ = [

UIToolBar background transparent

倖福魔咒の 提交于 2019-12-03 21:24:53
I am trying to place UIToolBar in UINavigationBar . UIToolbar* tempFontSizeToolBar = [[UIToolbar alloc] initWithFrame:CGRectMake(kPaginationToolBarOriginX,kPaginationToolBarOriginY,kPaginationToolBarWidth,kPaginationToolBarHeight)]; tempFontSizeToolBar.backgroundColor = [UIColor clearColor]; // create the array to hold the buttons, which then gets added to the toolbar NSMutableArray* buttons = [[NSMutableArray alloc] init]; [tempFontSizeToolBar setTranslucent:YES]; UIBarButtonItem *fontSizeBarButtonItem; fontSizeBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed

Need wantsFullScreenLayout behavior with NON-translucent bars on iOS 7

女生的网名这么多〃 提交于 2019-12-03 17:41:54
问题 I want to be able to have my view cover the whole screen (go behind the navigation and tool bars) with the translucent property of the navigationBar and toolbar set to NO (I want non-transparent bars). This was easy to accomplish prior to iOS 7 by setting wantsFullScreenLayout to YES. However, in iOS 7, I can't find any way of doing this. Any ideas? 回答1: wantsFullScreenLayout is deprecated at iOS 7. Try setting your view controller's edgesForExtendedLayout property to UIRectEdgeAll The iOS 7