Re: [問題] UIPickerView 改變外觀
※ 引述《myrainbow (Cindy)》之銘言:
: BTW..
: picker的內容值可不可以置中?
像這樣實作 delegate 就是置中的。
- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view
{
UILabel *label = nil;
if (view) {
label = (UILabel *)view;
}
else {
label = [[[UILabel alloc] initWithFrame:CGRectMake(0, 0, 300, 40)] autorelease];
}
label.backgroundColor = [UIColor clearColor];
label.text = @"Test"; // Replace it with what you want.
label.font = [UIFont boldSystemFontOfSize:26.0];
label.textAlignment = UITextAlignmentCenter;
label.textColor = [UIColor blackColor];
return label;
}
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.42.194.167
※ 編輯: zonble 來自: 220.128.103.143 (08/04 16:43)
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):