File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -43,32 +43,33 @@ @implementation MPNumericTextField
4343
4444- (id )initWithCoder : (NSCoder *)aDecoder {
4545 if ((self = [super initWithCoder: aDecoder])) {
46- [self setDefaults ];
46+ [self setDefaultsWithForcedAlignment: NO ];
4747 }
4848 return self;
4949}
5050
5151- (id )initWithFrame : (CGRect)frame {
5252 if ((self = [super initWithFrame: frame])) {
53- [self setDefaults ];
53+ [self setDefaultsWithForcedAlignment: NO ];
5454 }
5555 return self;
5656}
5757
5858- (id )init {
5959 if ((self = [super init ])) {
60- [self setDefaults ];
60+ [self setDefaultsWithForcedAlignment: YES ];
6161 }
6262 return self;
6363}
6464
65- - (void ) setDefaults {
65+ - (void ) setDefaultsWithForcedAlignment : ( BOOL ) forceAlignment {
6666 self.locale = [NSLocale currentLocale ];
6767 self.currencyCode = [self .locale objectForKey: NSLocaleCurrencyCode ];
6868 self.keyboardType = UIKeyboardTypeDecimalPad;
6969 self.type = MPNumericTextFieldDecimal;
7070 self.delegate = self.numericDelegate ;
71- self.textAlignment = NSTextAlignmentRight;
71+ if (forceAlignment)
72+ self.textAlignment = NSTextAlignmentRight;
7273}
7374
7475- (void ) setCurrencyCode : (NSString *)currencyCode {
You can’t perform that action at this time.
0 commit comments