iphone-common-codes-ccteam源代码 CCUISearchBar.m

//  
// CCUISearchBar.m
// CCFC
//
// Created by xichen on 11-12-27.
// Copyright 2011 ccteam. All rights reserved.
//


#import "CCUISearchBar.h"




@implementation UISearchBar(cc)


// set the searchBar to be transparent
- (void)setTransparent
{
[[self.subviews objectAtIndex:0] removeFromSuperview];
}


// create a common searchBar
+ (UISearchBar *)createCommonSearchBar:(CGRect)rect
{
UISearchBar *searchBar = [[UISearchBar alloc] initWithFrame:rect];
return [searchBar autorelease];
}


// remove the background of the searchbar
- (void)removeBackground
{
for(UIView *subview in self.subviews)
{
if([subview isMemberOfClass:NSClassFromString(@"UISearchBarBackground")])
{
[subview removeFromSuperview];
break;
}
}
}


@end

 

可能有更新:

googlecode链接地址:http://code.google.com/p/iphone-common-codes-ccteam/source/browse/trunk/CCFC/files/CCUISearchBar.m


github地址: https://github.com/cxsjabc/iphone-common-codes-ccteam/tree/master/CCFC/files/CCUISearchBar.m

 

posted @ 2012-01-12 09:46  cc_team  阅读(182)  评论(0编辑  收藏  举报