Ios UIPicker中的UIFont大小未更改
我正在尝试使用以下代码更改UIPicker中元素的字体和大小:Ios UIPicker中的UIFont大小未更改,ios,uipickerview,uifont,Ios,Uipickerview,Uifont,我正在尝试使用以下代码更改UIPicker中元素的字体和大小: - (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view { UILabel *pickerViewLabel = (id)view; if (!pickerViewLabel) {
- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view
{
UILabel *pickerViewLabel = (id)view;
if (!pickerViewLabel) {
pickerViewLabel= [[UILabel alloc] initWithFrame:CGRectMake(0.0f, 0.0f, [pickerView rowSizeForComponent:component].width - 10.0f, [pickerView rowSizeForComponent:component].height)];
}
pickerViewLabel.backgroundColor = [UIColor clearColor];
pickerViewLabel.text = _startTimeArray[row];
pickerViewLabel.font = [UIFont fontWithName:@"Helvetica Neue Regular" size:(22)];
return pickerViewLabel;
}
我可以更改字体的类型,但大小保持不变,无论我输入什么值。有人知道为什么字体大小没有改变吗?谢谢大家! 您使用了错误的字体名称。试试直升机。 您可以找到所有可用的字体名称