'StackLayout with Labels acting weird
So I'm coding a Hang Man game. I've done it with WPF already and now trying with Xamarin. In WPF, I figured out a smart way to show the correct guessed letters:

So I go through every Label in this StackLayout and I look if the label's content is equal to the triedLetter. If so, I set the label to visible.
Btw. the method to give each label a letter from the word:
![letters: Char[] with each letter of the word | lblLetter1: each label's name](https://i.stack.imgur.com/sLNVq.png)
On Xamarin, this happens:
wordToGuess = test
every Label: ----
triedLetter: t -> StackLayout: Tt--
triedLetter: s -> StackLayout: Tst-
triedLetter: e -> StackLayout: Test
On my wpf project it looked like this:
wordToGuess = test
every label: ----
triedLetter: t -> StackLayout: T--t
triedLetter: s -> StackLayout: T-st
triedLetter: e -> StackLayout: Test
Any idea why? Seems like StackLayouts are acting different from StackPanels on WPF.
And yes, I know there are some questions about the same topic, but they're doing it differently. And before I take someone else's idea, I like to solve my way instead.
Solution 1:[1]
Solve :
Instead of label.IsVisible = true/false, I used label.Opacity = 0/100
Thanks to Skin for the solution !
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Sajed |
