zekunyan / TTGTagCollectionView

Useful for showing text or custom view tags in a vertical or horizontal scrollable view and support Autolayout at the same time. It is highly customizable that most features of the text tag can be configured. 标签流显示控件,同时支持文字或自定义View
http://tutuge.me
MIT License
1.89k stars 260 forks source link

On horizontal scroll direction collectionView gets uncontrolable width #132

Closed Karahan00 closed 2 years ago

Karahan00 commented 2 years ago

The tag collectionView gets a confusing width after scroll direction is set on horizontal.

tagSelectorCollection.scrollDirection = TTGTagCollectionScrollDirection.horizontal

See image what happens: Bug

if I'am removeing the scrollDirection property than everything works fine. Can anyone help me? OK

zekunyan commented 2 years ago

The new version 2.2.0 fix this problem.

Karahan00 commented 2 years ago

The new version 2.2.0 fix this problem.

Thank you very much 💪🏽

Karahan00 commented 2 years ago

The new version 2.2.0 fix this problem.

Hey @zekunyan,

unfortunately now I'am faceing with a new problem. If I'am setting the .direction property the problem with the uncontrolable width is sloved but there is only one line inside the collectionView. If I'am setting the .numberOfLines property to 0 to get unlimited lines this didn't work. On vertical direction everything works fine.

code

bug

Can you help me?

Greetings

zekunyan commented 2 years ago

Can you provide Demo code for this problem ?

Karahan00 commented 2 years ago

Can you provide Demo code for this problem ?

Unfortunely I can't share an fully demo project or code. Because all of the Work/Project is from an Company. The only Code I could share was in my question. The only thing I'am doing is to call the 'delegate' methods for the TTTagCollectionView and than set all properties I need. And if I'm setting the .numberOfLines property to '0' on '.horizontal' scroll direction it's always one line.

zekunyan commented 2 years ago

@Karahan00

In the horizon mode, the numberOfLines property can not be set to 0. Because the TTTagCollectionView does not know 'how to calculate the lines with unlimit horizontal scroll width'

image