cruffenach / CRToast

A modern iOS toast view that can fit your notification needs
MIT License
4.16k stars 465 forks source link

Image/Activity Indicator Alignment Issues (RE-OPENED) #136

Open nmock opened 9 years ago

nmock commented 9 years ago

Issue https://github.com/cruffenach/CRToast/issues/131 was not fixed with the pull request, see screenshot from latest demo.

img_1595

dmiedema commented 9 years ago

I'm currently working on a few text alignment issues that may or may not address this.

What is wrong with the current implementation?

What resolution would you prefer?

nmock commented 9 years ago

@dmiedema I'm simply trying to center a piece of text and activity indicator/image. The expected behavior is that if setting both to alignment center, the text would appear exactly centered and the alignment of the activity indicator/image would be compensated by floating to the left of the text.

As you can see in the screenshot, the current implementation will just naively center both elements.

dmiedema commented 9 years ago

Cool cool. Seems reasonable enough. The only reason it doesn't do anything like that now is I attempted to make as few assumptions as possible in regards to alignment/shifting things away from where they were requested.

If you have any current work arounds/changes to accomplish that I'm sure others would appreciate it and/or PRs are always welcome.

jadar commented 9 years ago

It might make sense to add a new boolean value, "isRelativeToText." If it's set to true, the activity indicator/image will be on the left or right sides of the text instead of the toast view.

dmiedema commented 9 years ago

How would we determine right or left side? current locale?

jadar commented 9 years ago

It would still use the usual alignment keys, they'd just be relative to the text.