1
我有UISearchBar
与自定义InputView。现在我无法在iOS8
中为UISearchBar设置自定义输入视图。它正在崩溃。UISearchBar在iOS8中自定义InputView崩溃
这是我如何设置自定义InputView为的UISearchBar
for(int i =0; i<[[[self.sBar.subviews objectAtIndex:0] subviews] count]; i++) {
if([[[[self.sBar.subviews objectAtIndex:0] subviews] objectAtIndex:i] isKindOfClass:[UITextField class]])
{
[[[(UITextField*)[sBar.subviews objectAtIndex:0] subviews] objectAtIndex:i] setFont:[UIFont fontWithName:@"CustomFont" size:15]];
UITextField* search=[[(UITextField*)[sBar.subviews objectAtIndex:0]subviews] objectAtIndex:i];
search.delegate = self;
[[[(UITextField*)[self.sBar.subviews objectAtIndex:0] subviews] objectAtIndex:i] setInputView:MyKeyboard];
}
这里是崩溃日志。
Could not load the "" image referenced from a nib in the bundle with identifier "com.company.MyApp"
2014-09-23 13:34:13.816 MyApp[1651:61729] Could not load the "" image referenced from a nib in the bundle with identifier "com.company.MyApp"
它在iOS 7中正常工作,但现在在iOS8中崩溃。
我该如何解决?
我也面临同样的问题,任何机构都可以帮助我解决这个问题。 – jamil 2014-10-13 06:01:17
@Shazad。我回答了我自己的问题,适用于iOS8。核实! – 2014-10-13 06:19:57