由于某种原因,我的分段控件中的字体不是垂直居中的。有没有办法将字体向上移动到垂直居中?
我正在设置的唯一设置如下(除了声明活动/非活动/分隔图像):
NSDictionary *normalSegmentedControlAttributes = [NSDictionary dictionaryWithObjectsAndKeys:
[UIColor blackColor], UITextAttributeTextColor,
[UIColor clearColor], UITextAttributeTextShadowColor,
[NSValue valueWithUIOffset:UIOffsetMake(0, 1)], UITextAttributeTextShadowOffset,
[UIFont fontWithName:kFont size:kSegConFontSize], UITextAttributeFont,
nil];
[[UISegmentedControl appearance] setTitleTextAttributes:normalSegmentedControlAttributes forState:UIControlStateNormal];
NSDictionary *selectedSegmentedControlAttributes = [NSDictionary dictionaryWithObjectsAndKeys:
[UIColor whiteColor], UITextAttributeTextColor,
[UIColor clearColor], UITextAttributeTextShadowColor,
[NSValue valueWithUIOffset:UIOffsetMake(0, 1)], UITextAttributeTextShadowOffset,
[UIFont fontWithName:kFont size:kSegConFontSize], UITextAttributeFont,
nil];
[[UISegmentedControl appearance] setTitleTextAttributes:selectedSegmentedControlAttributes forState:UIControlStateSelected];