Can we not set width and height for dynamic cards?

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?

2 Likes

And what do you expect with such low values?!
0.4 pixels? 10 pixels?

You know that you can calculate the width? Because you already answered your own question with the topic to:

So what is now your real question?!

1 Like

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?

1 Like

The answer is right there in the quoted text. In your case the container will be the one in which you keep the card view

1 Like

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:

  1. Have a label that can change its width relative to the parent. “seemingly change” like the suggestions in this thread is fine
  2. 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.

1 Like

According to above block you have not created card.
Create CardView First
then Set height
you have not created card of id 1.

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…

1 Like

aia that i have tried…
labelwidth.aia (14.2 KB)

2 Likes

I see, so yusufcihan’s dynamic label width can be made to change programmatically? Do you mind posting a picture on how to do that?

1 Like

Thank you for the AIA file. I will try it.

1 Like

Okay if that helps you.
you can mark it as solution…

1 Like

Thanks so much. That’s cool!

1 Like

Its Okay we are here to help you… :smiling_face_with_three_hearts: :smiling_face_with_three_hearts:

1 Like

Yeah.

My extension just calls the components’ own properties, so it doesn’t require own setter / getter blocks.

3 Likes

Nice! Again, thank you for your awesome extension!!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.