Hello everyone! I want to create custom like and dislike, using images like this:
I have to create three cases:
- Only Like
- Only Dislike
- Without Likes and Dislikes
And I set visibility my like_active and dislike_active as false at first:
Then instead of flow functions, I used a formula for like and dislike.
First of all I gave page variables for like and dislike:
And then for each visibility of these components I gave formulas like these:
And it is working, when i tap to the like and dislike separately:
But I have a problem and I can’t solve it:
When I tap to the dislike_inactive(gray) from the like_active(yellow) it shows me all custom images…
Or vice versa, from dislike_active(yellow) to the like_inactive(gray).
I tried to set formulas many times, but I can’t solve it…
Could anyone help?
For more details you can run and see my app…
my app id: 190519.
|| operator evaluates to
true if either one of the statements evaluate to true, that’s why you’re getting double visibilities.
Visibilities should work like this:
pageVars.likeTab === "likeInactive"
pageVars.likeTab === "likeActive"
pageVars.dislike_Tab === "dislikeInactive"
pageVars.dislike_Tab === "dislikeActive"
What does it “===” mean?
I set as written above, but I have empty image icons there… Although I set like_inactive and dislike_inactive as True…
=== signifies deep equality, check out this article.
I assumed that you were giving
likeTab text values because you were comparing them to texts (
"") in the formulas, not variables. If you give likeTab and dislikeTab true/false values, you can just write:
Okay. Could you just explain how to create custom like and dislike?)
Hi, I would have the four images like you do, then two true/false variables
dislike with an initial value of
false for both.
On component tap, I would set the variable to the opposite value with a formula:
The visibility bindings for the images would be:
Thumbs up (active)
Thumbs up (inactive)
Thumbs down (active)
Thumbs down (inactive)