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