AliSoftware/OHAttributedLabel — Issue #62: Right / Center alignment
Author: mortenperriard
Created: 2012-02-24 09:44:20+00:00
State: open

Setting alignment to UITextAlignmentCenter results in text being right aligned, and UITextAlignmentRight results in center aligned text. Looking at the code, it appears that the alignment value is cast from UITextAlignment to CTTextAlignment, which could explain the mixup - see enums below:

typedef enum {
UITextAlignmentLeft = 0,
UITextAlignmentCenter,
UITextAlignmentRight, // could add justified in future
} UITextAlignment;

enum
{
kCTLeftTextAlignment = 0,
kCTRightTextAlignment = 1,
kCTCenterTextAlignment = 2,
kCTJustifiedTextAlignment = 3,
kCTNaturalTextAlignment = 4
};
typedef uint8_t CTTextAlignment;