Is there no way to set the width of a dynamic label?
No matter what I filled in for “width” (0, 0.4, 10, 50 100), the width still stays the same – fills the vertical arrangement 100%. I can change the width of the vertical arrangement through “designer” but what about labels? Can I do it programmatically?
According to the thread below, I can only fill in -1 or -2. Well, those also fills the vertical arrangement 100%. I need to be able to adjust the width of the label relative to the vertical arrangement. How do I do that?
Thanks for answering Mika. I guess I am real slow. I did read that before. But I still don’t understand how to set the width of the label with respect to the parent. Earlier you said 0.4 pixels is too small, but in the quote it says 0.4 is 40% relative to parent’s width. And I also tried up to 50 and 100, even 0 (if in pixels, not percentage). No change, the label ALWAYS fill the parent (Vertical arrangement component).
So, how exactly do I make the label component smaller in width than the vertical arrangement and changeable programmatically? How exactly do I “set the width/height to this: A x Parent.”? What should I use to do that?
Ok. I did try to programmatically change the width of the vertical arrangement component, so the label inside it is constricted by it. This works. Problem is, because the vertical arrangement is not a dynamic component, I am not able to recreate the label along with the vertical arrangement with the press of a button. Do you have any advice? Here’s what I need:
Have a label that can change its width relative to the parent. “seemingly change” like the suggestions in this thread is fine
I need to have that label inside a dynamic card view, such that when I create a new dynamic card view, a new label can be created and I can adjust the width of it as well
Sort of like a poll app. A new card is a new poll bar, where the bar can increase in size as people vote.
hi @yulius
I have tried 3 way for setting width for label…
So first i created a non dynamic label to just check that is width working or not? but it worked.
Secondly i have tried yusifcihan’s dynamic extension to create dynamic label and set it widths. And that also worked fine as expected.
at the end when i used dynamic label by kodular and set the width but it not work, for this i have tried many way like with respect to screen width. arrangement width, direct value but nothing worked, everytime the width was fill parent. So we can say that its bug in kodular’s dynamic label.
so now we can use yusifcihan’s dynamic extension for creating label of specified width…