Re: [問題] UIPickerView 改變外觀

看板MacDev作者 (zonble)時間15年前 (2009/08/04 08:40), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/2 (看更多)
※ 引述《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)
文章代碼(AID): #1ATuEJj4 (MacDev)
文章代碼(AID): #1ATuEJj4 (MacDev)