Tag: text alignment

设置自定义字体时文本alignment问题

当我为分段控件设置自定义字体时,它将更改垂直文本alignment方式。 我正在使用下面的代码来设置字体。 // I dont think these lines are creating any issue but just wanted to paste all the code self.segmentType.layer.borderColor = navigationTintColor.CGColor; self.segmentType.layer.cornerRadius = 0.0; self.segmentType.layer.borderWidth = 1.5; // These are the lines that are changing the text alignment UIFont *font = [UIFont fontWithName:ftHelveticaNeueLTPro_Th size:13.5]; NSDictionary *attributes = [NSDictionary dictionaryWithObject:font forKey:UITextAttributeFont]; [self.segmentType setTitleTextAttributes:attributes forState:UIControlStateNormal]; […]