如何更改iphone中UISearchBar的UiSearchbar高度,宽度,颜色和Uitextfield高度?
我要更改UISearchBar
。textfield height and width
。 我的问题是如何更改UiSearchbar height ,width , color
和Uitextfield Height
in UISearchBar
in iphone
?如何更改iphone中UISearchBar的UiSearchbar高度,宽度,颜色和Uitextfield高度?
任何想法或建议将受到欢迎。
[searchBar setFrame:CGRectMake(0,0,80,30)];
希望它有帮助你:)
- (void)setSearchIconToFavicon
{
// Really a UISearchBarTextField, but the header is private.
[[mySearchBar.subviews objectAtIndex:0] setAlpha:0.0];
UITextField *searchField = nil;`enter code here`
for (UIView *subview in mySearchBar.subviews)
{
if ([subview isKindOfClass:[UITextField class]])
{
searchField = (UITextField *)subview;
break;
}
}
if(!(searchField == nil))
{
searchField.textColor = [UIColor blackColor];
[searchField setBackground: [UIImage imageNamed:@"searchFieldBG.png"] ];
[searchField setBorderStyle:UITextBorderStyleNone];
searchField.frame = CGRectMake(4, 5, 285, 50);
}
}
这段代码没有调用,我把这段代码放在哪里以及如何调用这段代码? – 2013-02-20 07:44:52
uiseach酒吧有委托方法 – 2013-02-20 07:48:34
- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar – 2013-02-20 07:49:46
您可以从厦门国际银行的源代码改变文本框的高度。要以源代码格式打开xib,您需要右键单击xib文件,然后选择“作为源代码打开”。在该代码中搜索文本字段并相应地更改高度。
你可以改变颜色本身在故事板下的属性检查器中,但是,要设置X,Y,宽度&高度我用这个...
首先创建您的UISearchBar对象:
”。 H '
@property (strong, nonatomic) IBOutlet UISearchBar *searchBar;
然后在viewDidLoad中/ willappear把这段代码
' 的m”
self.searchBar.frame = CGRectMake(34, 244.5, 306, 30);
根据需要进行调整。
不,它没有帮助... – 2013-02-20 07:18:27
请张贴一些代码,这样我就可以理解你如何使用搜索栏:) – Rushabh 2013-02-20 07:20:41