# Setting a button's background picture to blank dynamically

**URL:** https://community.thunkable.com/t/setting-a-buttons-background-picture-to-blank-dynamically/1767628
**Category:** Questions about Thunkable X
**Tags:** button, any-component
**Created:** [March 4, 2022, 6:08pm UTC](https://community.thunkable.com/t/setting-a-buttons-background-picture-to-blank-dynamically/1767628 "2022-03-04T18:08:05Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [March 4, 2022, 6:08pm UTC](https://community.thunkable.com/t/setting-a-buttons-background-picture-to-blank-dynamically/1767628/1 "2022-03-04T18:08:05Z")

</div>

I often use the Any Component blocks to loop through a series of buttons in a screen/row/column (Snap to Place interface) and hide some of them. Unfortunately, changing a button’s “visible” property affects the layout of components next to it (they move over to replace it) so I can’t use that. I want the layout to remain the same but the image itself to disappear. Think of a grid of faces with one missing/blank.

What I typically do is to loop through and change the background picture to “” (empty string). This had been working but I guess a change to the coding now prevents it.

This project demonstrates the issue. If you tap on the button, it should remove the image of the owl: [Thunkable](https://x.thunkable.com/copy/a9978ea644e890f1d1134bd0a41ab4e0)

Does anyone have a suggestion for something else to try until this can be fixed? I thought about making a .png with a single transparent (1% opacity) pixel and replacing the background picture with that but I haven’t tried it yet. **Edit:** That does work as a workaround (project: [Thunkable](https://x.thunkable.com/copy/9b58b2585c35bafa08c6145e4c349d07)).

These blocks work in a web preview but not in Thunkable Live on an iPhone:

 ![156816666-34bda38d-f15f-459f-b0ed-f4375c0f8e09](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/3/d387c6ddd72174b049cc196b16db4ec6242b4957.png)

Bug reported here: [Setting button's picture to "" using Any Component blocks fails · Issue #1127 · thunkable/thunkable-issues · GitHub](https://github.com/thunkable/thunkable-issues/issues/1127)

---

<div class="post-metadata">

### Author: ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)
#### Post date: [March 5, 2022, 11:15am UTC](https://community.thunkable.com/t/setting-a-buttons-background-picture-to-blank-dynamically/1767628/2 "2022-03-05T11:15:10Z")

</div>

I tried both your projects and both works in Android. So this thing is again specific to iOS.

However, I created another project (copying yours) and placed the button inside a row and duplicated the row to create 3 rows (all set to **relative size** ).

Now if you click on the middle one, I set visible property to false and other components don’t get effected as they are in separate containers.

[https://x.thunkable.com/projectPage/622343d11aadef00124feec9](https://x.thunkable.com/projectPage/622343d11aadef00124feec9)

**[Update]**

I tried using the background picture but instead of assigning empty string **“”** or **null** I put a space in the `text block` and it worked. The image disappeared in Android.

Can you try it in iOS?

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [March 5, 2022, 9:32pm UTC](https://community.thunkable.com/t/setting-a-buttons-background-picture-to-blank-dynamically/1767628/3 "2022-03-05T21:32:55Z")

</div>

> [@muneer](#):
>
> [Thunkable](https://x.thunkable.com/projectPage/622343d11aadef00124feec9)

Good idea to place the button in a row and hide the button but keep the row visible. That should work for me.

I can’t open your project by the way:

> Oops! The project you are looking for was either deleted or may not be public.

---

<div class="post-metadata">

### Author: ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)
#### Post date: [March 5, 2022, 9:36pm UTC](https://community.thunkable.com/t/setting-a-buttons-background-picture-to-blank-dynamically/1767628/4 "2022-03-05T21:36:39Z")

</div>

> [@tatiang](#):
>
> I can’t open your project by the way:

I’m sorry, I just looked for it and it seems it vanishes. I must have deleted it.

Here is a new one  
[https://x.thunkable.com/projectPage/6223d7ceb9166b0011284ea3](https://x.thunkable.com/projectPage/6223d7ceb9166b0011284ea3)

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [March 5, 2022, 10:37pm UTC](https://community.thunkable.com/t/setting-a-buttons-background-picture-to-blank-dynamically/1767628/5 "2022-03-05T22:37:18Z")

</div>

That works, thank you!

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)
#### Post date: [June 3, 2022, 10:38pm UTC](https://community.thunkable.com/t/setting-a-buttons-background-picture-to-blank-dynamically/1767628/6 "2022-06-03T22:38:15Z")

</div>

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