自定义UISearchDisplayController [英] Customize UISearchDisplayController
本文介绍了自定义UISearchDisplayController的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
替代文字http://img210.imageshack.us/img210/5992/searchdisplaycontroller.png
以下对象是否可自定义?
Are the following objects customizable?
1。 UISearchBar范围按钮(UISegmentedController)
2。 UIResultsTableView
3。键盘(至少它是黑色的)
推荐答案
替代文字http://img527.imageshack.us/img527/9775/searchdisplaycontrollerz.png
我能够通过一种黑客代码更改分段控件:
I was able to change the segmented control by a sort-of hack code:
- (void)searchDisplayControllerWillBeginSearch:(UISearchDisplayController *)controller {
for (UIView *subview in self.view.subviews) {
for (UIView *subview2 in subview.subviews) {
if ([subview2 isKindOfClass:[UISegmentedControl class]]) {
UISegmentedControl *segmentedControl = (UISegmentedControl *)subview2;
segmentedControl.tintColor = [UIColor blackColor];
segmentedControl.segmentedControlStyle = UISegmentedControlStyleBar;
}
}
}}
然而按钮是巨大的,我怎么能修复它所以它们和原版一样漂亮?
However the buttons are HUGE, how could I fix it so they are just as pretty as the original?
这篇关于自定义UISearchDisplayController的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文