uitoolbar

make a UIBarButtonItem with customView behave like Flexible-Space item

与世无争的帅哥 提交于 2019-12-01 15:07:46
I have a UIBarButtonItem that has a UITextField as its customView. The toolbar contains this item and a few buttons. As the toolbar resizes (say on a device-orientation change) I want the UITextField to grow or shrink (width) to occupy all the available space in the toolbar. Short of figuring out the combined sizes of all the buttons in the toolbar, then setting the UITextField width appropriately, is there just some magical way to make this item behave like a flexible-space bar item? If you set UIViewAutoresizingFlexibleWidth to your textfield it should automatically shrink or grow. Oded Ben

make a UIBarButtonItem with customView behave like Flexible-Space item

守給你的承諾、 提交于 2019-12-01 14:46:20
问题 I have a UIBarButtonItem that has a UITextField as its customView. The toolbar contains this item and a few buttons. As the toolbar resizes (say on a device-orientation change) I want the UITextField to grow or shrink (width) to occupy all the available space in the toolbar. Short of figuring out the combined sizes of all the buttons in the toolbar, then setting the UITextField width appropriately, is there just some magical way to make this item behave like a flexible-space bar item? 回答1: If

How do I get the frame width of UIAlertController?

僤鯓⒐⒋嵵緔 提交于 2019-11-30 21:48:05
I'd like to get the width of UIAlertController frame so that I can specify the width of UIPickerView and UIToolbar which will come with the UIAlertController. I've tried to use the following statement to get the width. alertPicker.view.frame.size.width But, the width is as same as viewController's: self.view.frame.size.width Any idea to get the width of the UIAlertController? Thanks a lot. This is my code. UIAlertController *alertPicker = [UIAlertController alertControllerWithTitle:nil message:@"\n\n\n\n\n\n\n\n\n\n\n\n" preferredStyle:UIAlertControllerStyleActionSheet]; CGRect pickerFrame =

Move UINavigationController's toolbar to the top to lie underneath navigation bar

北战南征 提交于 2019-11-30 20:49:35
When you create a UINavigationController , you can reveal its default hidden UIToolbar via setToolbarHidden:animated: (or by checking Shows Toolbar in Interface Builder). This causes a toolbar to appear at the bottom of the screen, and this toolbar persists between pushing and popping of view controllers on the navigation stack. That is exactly what I need, except I need the toolbar to be located at the top of the screen. It appears that's exactly what Apple has done with the iTunes app: How can one move UINavigationController 's toolbar to the top to lie underneath the navigation bar instead

How to hide inputAccessoryView without dismissing keyboard

青春壹個敷衍的年華 提交于 2019-11-30 18:29:11
I am using a toolbar in the inputAccessoryView property of a textView. When the keyboard shows, it displays the toolbar as expected. When the device is rotated I want to remove the toolbar. I tried: myTextView.inputAccessoryView.hidden = !layoutIsPortrait; This does hide the toolbar, but leaves the outline of the taller keyboard behind. The keyboard is apparently still sized to fit the toolbar. It looks bad and interferes with touch events of underlying responders. myTextView.inputAccessoryView = nil; Works only if I resignFirstResponder, then becomeFirstResponder again. This is not acceptable

How do I get the frame width of UIAlertController?

对着背影说爱祢 提交于 2019-11-30 17:11:26
问题 I'd like to get the width of UIAlertController frame so that I can specify the width of UIPickerView and UIToolbar which will come with the UIAlertController. I've tried to use the following statement to get the width. alertPicker.view.frame.size.width But, the width is as same as viewController's: self.view.frame.size.width Any idea to get the width of the UIAlertController? Thanks a lot. This is my code. UIAlertController *alertPicker = [UIAlertController alertControllerWithTitle:nil

UINavigationBar appearance refresh?

强颜欢笑 提交于 2019-11-30 08:13:17
In my iPad app I have an application settings view. One of the options lets the user switch interface color scheme. The settings view is loaded by segue to a separate view controller than my "main" app's window. When they pick a new color I switch the colorSchemeColor variable and do this: // set the colors and refresh the view [[UINavigationBar appearance] setBarTintColor:colorSchemeColor]; [[UIToolbar appearance] setBarTintColor:colorSchemeColor]; [[UITabBar appearance] setBarTintColor:colorSchemeColor]; However, none of the bars change color until I exit my settings view! (When the settings

Move UINavigationController's toolbar to the top to lie underneath navigation bar

旧时模样 提交于 2019-11-30 04:52:20
问题 When you create a UINavigationController , you can reveal its default hidden UIToolbar via setToolbarHidden:animated: (or by checking Shows Toolbar in Interface Builder). This causes a toolbar to appear at the bottom of the screen, and this toolbar persists between pushing and popping of view controllers on the navigation stack. That is exactly what I need, except I need the toolbar to be located at the top of the screen. It appears that's exactly what Apple has done with the iTunes app: How

Adding tool bar on top of the uikeyboard

ⅰ亾dé卋堺 提交于 2019-11-30 04:51:11
I have a toolbar and i would like to place it on top of the keyboard. In the keyboardwillshow notification, i tried to add toolbar to the keyboard but no luck, i cant add Please let me know UIWindow* tempWindow = [[[UIApplication sharedApplication] windows] objectAtIndex:1]; UIView* keyboard; for(int i = 0; i < [tempWindow.subviews count]; i++) { //Get a reference of the current view keyboard = [tempWindow.subviews objectAtIndex:i]; //Check to see if the description of the view we have referenced is "UIKeyboard" if so then we found //the keyboard view that we were looking for if([[keyboard

UINavigationBar appearance refresh?

女生的网名这么多〃 提交于 2019-11-29 05:51:27
问题 In my iPad app I have an application settings view. One of the options lets the user switch interface color scheme. The settings view is loaded by segue to a separate view controller than my "main" app's window. When they pick a new color I switch the colorSchemeColor variable and do this: // set the colors and refresh the view [[UINavigationBar appearance] setBarTintColor:colorSchemeColor]; [[UIToolbar appearance] setBarTintColor:colorSchemeColor]; [[UITabBar appearance] setBarTintColor