I upgraded an older version(ios6) of a tabbed based app to latest iOS. The app uses my own customkeyboard like showing in the image attached. The tabbar supposed to stay on top of the keyboard, but with new iOS versions, I get this new toolbar by default. How do I get rid of this bar because it's sitting on top of my tabbar?
UITextInputAssistantItem* item = [textField inputAssistantItem];
item.leadingBarButtonGroups = #[];
item.trailingBarButtonGroups = #[];
The thing on the top is a suggestion list.
I just tested this in Xcode. The way to hide is to disable auto-correction. Do it programmatically or using storyboard by highlighting search bar.
searchBar.autocorrectionType = UITextAutocorrectionTypeNo;
Related
I know SearchDisplayController is deprecated, but Storyboard still supports it, and it is an easy way to present tableViewController on top of your view controller. I have been using it, and I would still prefer to use that. And in iOS 11, when I run my app, the status bar of the SearchDisplayController. after the search bar is focused, is pitch BLACK. Does anyone know how to solve this bug? Also if you realize, the margins of the searcher is off. I am using the default iOS 11 searchbar. Below is attached screenshot:
Have you tried to set the extendedLayoutIncludesOpaqueBars property to true?
searchDisplayController.extendedLayoutIncludesOpaqueBars = true
This is not the best solution actually, but It works to change status bar color.
if let statusBar = UIApplication.shared.value(forKeyPath: "statusBarWindow.statusBar") as? UIView {
statusBar.backgroundColor = //YOUR COLOR HERE
}
Keep in mind this will affect the whole app. If you need to change some views only then save the previous color to restore it.
Regards.
I have a "Clear" button. It clears 2 text fields back to being empty.
When the user clicks the "Clear" button once, I want it to change or become another button that adds back what it cleared. Like a "Redo" button.
How can I go about doing this? So far this is what my "Clear" button does:
- (IBAction)clearButton:(UIBarButtonItem *)sender {
_inputTextField.text = #"";
_outputTextField.text = #"";
_characterCount.text = #"0";
_characterCount.textColor = [UIColor blackColor];
}
I used to be able to use shake-to-undo, but after updating to iOS8 and xCode, no matter if I shake it, the redo menu does not pop up. It used to back in iOs7, but all it did was crash the application. Is there a way to fix this? I have it enabled but it just doesn't show up anymore.
Please don't berate my question. I tried searching but couldn't find it for a toolbar for iOS.
Hi I have create a new project on your requirement , have a look and reply :
https://github.com/ksbani/StapperRepo/archive/master.zip
I am getting a very weird issue while disabling a button in Xcode 5.1.1 and iOS SDK 7.1.
My button gets hidden when I disable the button in - (void)viewDidLoad or - (void)viewWillAppear:(BOOL)animated or in the nib.
The same code is properly working for iOS 7.0 and below.
myButton.enabled = NO;
Is this an Apple bug?
I had tried in different projects also but result is same.
I am using it Xcode 5.1 and it works perfectly on iOS 6 to iOS 7.1.
possibility is:
check whether the button is system or custom. it should be custom always.
Try making the button as myButton.enabled = YES; and see whether the button hidden in iOS 7.1.
Then check whether in nib file, you have set clear color for disabled state of the button.
May be your button is placed below another ui object (i.e. UIView), so it is hidden and disabled. If another view's user interaction is enabled, and this view happens to be above the button, then touch event is taken over by that view. Another issue can be that your button is beyond super view's bounds and this super view has clipToSubview enabled.
Actually the problem exists while i am setting the image. I am setting the image of each button using SpriteSheet. The image gets added dynamically after slicing and resizing in background. So whatever the state of button is it just set's the image of Disabled and normal state.
Now to resolve this i checked whatever the state of button it just sets its
if (myButton.state == UIControlStateDisabled)
{
myButton.enabled = YES;
[myButton setImage:returnImage forState:UIControlStateNormal]; // return Image is the image which i get from sprite sheet after slicing and resizing.
myButton.enabled = NO;
}
I'm using UIBarButtonItem in my project. I've tried to hide the UIBarButtonItem in iOS 6.1, but I was unable to do the same using the following code:
barbuttonname.tintColor = [UIColor clearColor];
barbuttonname.enabled = NO;
This code hides the UIBarButtonItem in iOS 7.1, but in iOS 6.0 it shows the UIBarButtonItem. How can this issue be fixed?
The reason is because use of tintColor for that purpose only became available in iOS 7. in iOS 6, the buttons also typically have borders and backgrounds and each bit is handled separately. In terms of what you're actually trying to accomplish here, I think you should go about it a different way.
Instead of modifying properties on the button to hide it, simply remove it from the navigation bar or wherever you have it. For example, if it is the right button on a UINavigationBar, you would just do:
myNavigationBar.rightBarButtonItem = nil;
Then, when you want to show it again
myNavigationBar.rightBarButtonItem = myButtonItem;
I am doing an application , using ARC. I add a button to the navigation controller as a subview and then remove it. It works fine on simulator but on device, after using for a long time, the buttons are hidden , but on touching on that area, it responds.
Could it be some memory issue?
Wherever you place button.hidden = YES, also place button.enabled = NO.