4

何らかの理由で、セグメント化されたコントロールのフォントが垂直方向の中央に配置されていません。フォントを上に移動して垂直方向の中央に配置する方法はありますか?

スクリーンショット

私がそれらに設定している唯一の設定は以下のとおりです(アクティブ/非アクティブ/ディバイダーイメージの宣言を除く):

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];
4

0 に答える 0