ShapeSheet formula for resizing only the parent shape not the sub shapes of the parent shape - visio

A parent shape has 3 sub shapes in it. When parent shape is resized the sub shapes(3) are also getting resized. So, when I resize the parent shape only particular sub shapes should resize not all. What ShapeSheet formula is required for the above situation?

You can set the ResizeMode cell to achieve this. For the sub-shapes you'll generally use the default (0) and this tells the shapes to use the ResizeMode value that's been set in the group shape. You can therefore set the group's ResizeMode cell to 1, which tells it to use repositioning only.
Here's a list of the values from the documentation:
0 Use group's setting - visXFormResizeDontCare
1 Reposition only - visXFormResizeSpread
2 Scale with group - visXFormResizeScale
If you want the sub-shapes use different behaviours then you can set the cell in each sub-shape accordingly.
Under the covers, using a value of 1, the Width and Height cells are set as absolute values, while 2 (and the default for group shapes) sets relative values. These are set when the shapes are added to the group, so you need to ensure the ResizeMode values are set first.

Each sub-shape will have to have its width and height formula values changed. Open the shapesheet editor for each sub-shape that you don't want to have resize, if you want the sub-shape width to always be 20mm then set the Width cell =GUARD(20mm). Similar for the Height cell.

Related

Scale Horizontal Layout Group's child layout elements while maintaining their aspect ratio

I am trying to maintain the aspect ratio of child elements within a Horizontal Layout Group when the total width of children would exceed the Layout Group's width.
Given the Horizontal Layout Group below, the child squares' total width fits within the parent so they do not need to scale:
If we add more children and their total width exceeds the Layout Group's width, but by default they do not scale accordingly:
The desired outcome would be that they scale proportionally to fit the Layout Group's width:
I have tried various configurations of settings on the Layout Group's properties and just cannot produce the desired outcome.
The closest I can get the below by checking Control Child Size: Width and setting a Layout Element component on the child and setting the preferred width and height.
Control Child Size: Whether the Layout Group controls the width and height of its child layout elements.
Use Child Scale: Whether the Layout Group considers the scale of its child layout elements when sizing and laying out elements. Width and Height correspond to the Scale > X and Scale > Y values in each child layout element’s Rect Transform component.
Child Force Expand: Whether to force the child layout elements to expand to fill additional available space.
My brain is just not getting to the correct config.
Hopefully, I am overlooking something simple.
It's possible:
Create a Horizontal Layer Group
Tick Control Child Size : Width
Tick Child Force Expand : Width & Height
Add an empty GameObject inside this Horizontal Layer Group
Add another empty GameObject inside the GameObject you made in step 4
Add an Aspect Ratio Fitter component to the GameObject you made in step 5
Set Aspect Mode : Fit In Parent
Alternative Solution that worked in my case:
Create a Horizontal Layer Group
Tick Control Child Size : Width
Tick Child Force Expand : Width & Height
Each child that you add inside the layout group must have an Aspect ratio fitter with:
Aspect mode: Width Controls height
Aspect Ratio: 1

equal heights for different labels in one row

I have 3 labels in a row they may have different number of words so each one may have different number of lines. I want at the end the height of views become the same. what should I do?
You want to use the Equal Heights constraint among your 3 labels. Below is an example. I have 3 labels in the same view, with the "lines" property of each label set to 0. Each has a top, leading, and width constraint applied (width = 100). So each label automatically grows taller as more text is added to them.
Now simply select all three labels and apply the Equal Heights constraint. Now two of the labels grow in height to match the third label. Now adding even more text to the label that has the most text will cause the other two labels to match its growing height. You can prove this directly within Interface Builder.

Storyboard labels constraints

I have 4 labels on my storyboard, aligned at baseline and with fixed distance between them.
Each label can have different values at runtime, and I would like that the group of these 4 labels is horizontally centered.
Didn't succeed to fix it !
I tried to put them in a view and center the view, but it doesn't work either.
Tried also to play with priorities, but didn't't succeed either...
Is it possible to achieve that in the storyboard ?
You can do this by putting your 4 labels inside of another view. Add the following constraints:
Set fixed distance constraints between the labels (3 constraints).
Set constraints to align the baselines of the labels (3 constraints).
Set a leading constraint from the leftmost label to the containing view. Set the constant to 0.
Set a trailing constraint from the rightmost label to the containing view. Set the constant to 0.
Set a constraint for the height of the view.
Set a constraint from the top of the left label to the top of its containing view.
Set a constraint to center the view horizontally.
Set a constraint to position the view vertically.
The width of the view will be determined by the intrinsic sizes of the labels plus the sizes of the distances in #1. This width will change as the contents of the labels changes, and the view will keep the group centered.
You can use a Stack View for this:
In the 'Attribute Inspector' you can set for example that each text field has an equal width and a spacing of 5 points between them:
You can then use your Stack View to center horizontally like your normally would do.

How to add horizontal bar in table row whose width depends on the value passed

I am implementing vote application in which i need to show horizontal bar in table row whose width is depended on particular value. This horizontal bar will act as a indicator to show percentage of vote.
One solution could be like this.....
Use two UILabels..... with different color..... combined length of this label would be 100px and we will vary individual's length based on the percentage......
Thanks,
You can use progress bar in the 'cell. backgroundView'.
or you can have imageView and overriding its draw rect method to draw the percentage of votes

define height of tine mce

I want to set height of tiny mce depending on the type of element it is initialized for. For example, I want to set height 200px for headings and use mce's default size for for paragraph and ordered and unordered lists. Also, I want to adjust height of the mce instance with the content. Instead of adding vertical scrolls, it should increase with content.
Help APPRECIATED.
For this you need to specify editor_css in the tinimce init.
There you should change the desired values.