Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/tensorflow/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios UIPicker中的UIFont大小未更改_Ios_Uipickerview_Uifont - Fatal编程技术网

Ios UIPicker中的UIFont大小未更改

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) {

我正在尝试使用以下代码更改UIPicker中元素的字体和大小:

- (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;
}

我可以更改字体的类型,但大小保持不变,无论我输入什么值。有人知道为什么字体大小没有改变吗?谢谢大家!

您使用了错误的字体名称。试试直升机。 您可以找到所有可用的字体名称