TomSwift/TSAlertView

When text is too long it shows both messageLabel and messageTextView

Opened this issue · 0 comments

So I propose to do the following changes in

  • (CGSize) recalcSizeAndLayout: (BOOL) layout
    My added lines are marked with the word "NEW"

:
:

// message
if ( self.message != nil )
{
if ( self.usesMessageTextView )
{
self.messageTextView.frame = CGRectMake( kTSAlertView_LeftMargin, y, messageViewSize.width, messageViewSize.height );
[self addSubview: self.messageTextView];
y += messageViewSize.height + kTSAlertView_RowMargin;

            UIImageView* maskImageView = [self messageTextViewMaskView];
            maskImageView.frame = self.messageTextView.frame;
            [self addSubview: maskImageView];
                            self.messageLabel.hidden=YES; // NEW
                            self.messageTextView.hidden=NO; // NEW
        }
        else
        {
            self.messageLabel.frame = CGRectMake( kTSAlertView_LeftMargin, y, messageViewSize.width, messageViewSize.height );
            [self addSubview: self.messageLabel];
            y += messageViewSize.height + kTSAlertView_RowMargin;
                            self.messageLabel.hidden=NO; // NEW
                            self.messageTextView.hidden=YES; // NEW
        }
    }