Skip to content

Add method setMessage and property messageLineBreakMode - #28

Merged
friend-lga merged 1 commit into
friend-lga:improvementsfrom
darling0825:master
May 14, 2017
Merged

friend-lga merged 1 commit into
friend-lga:improvementsfrom
darling0825:master

Conversation

@darling0825

Copy link
Copy Markdown

No description provided.

@friend-lga

Copy link
Copy Markdown
Owner

Hi, thanks for PR.
Can you explain, why do you need this changes?

I think that:

  1. Message is just a simple text, for good readability, it should break lines with NSLineBreakByWordWrapping, not with NSLineBreakByCharWrapping. And it definitely should be fully visible, that's why we can't use clipping and truncating.
  2. If you want to make messages dynamic, you need to recalculate full layout every time it changed. And why only messages? If messages will be dynamic, then other pieces of library should be dynamic too: title, buttons... even style.

To make message dynamic you can use LGAlertView with inner view and make any changes inside it. Check in demo project:

  • "LGAlertView + UIView"
  • "LGAlertView + UIScrollView"
  • "LGAlertView + XIB"

@darling0825

Copy link
Copy Markdown
Author
  1. In the process of downloading multiple files, I would like to dynamically display the message name in the alert view, only show the percentage of progress will be a bit monotonous.

  2. Sometimes the file name will be longer, would like to flexibly set LineBreakMode, such as NSLineBreakByTruncatingMiddle, so set this property visible.

@friend-lga
friend-lga changed the base branch from master to improvements May 14, 2017 08:50
@friend-lga
friend-lga merged commit f377d38 into friend-lga:improvements May 14, 2017
@friend-lga

friend-lga commented May 14, 2017

Copy link
Copy Markdown
Owner

I tried implement it, but really, It's not so easy.

Initially, for this purpose we had progressLabelText property. In the latest release 2.4.0 I added ability to use it with alertView with activityIndicator as well as with progressView.

Check demo project for version 2.4.0

  • "LGAlertView + ActivityIndicator"
  • "LGAlertView + ProgressView"

You can make it looks like this:

+-----------------------+
|         Title         |
|        Message        |
| #####================ |
|       File name       |
|        Percent        |
+-----------------------+

Or like this:

+-----------------------+
|         Title         |
|        Message        |
| #####================ |
|  Percent | File name  |
+-----------------------+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants