Skip to content
Advertisement

React native layouts – view not showing inside touchable opacity

I am new to programming and I have been running with this problem for the past week and haven’t been able to solve it any other way, please help.

I have a styles/layout issue on my react native application. I have a touchable opacity and inside it I want to have two views (one that will contain an image and one that will be a text box). So far I just have two empty views with a distinct background color to be able to visualize the layout. currently, it only shows the container ‘touchable opacity’ view (i.e. the yellow background). I have tried flex, align items, justify content, and a combination of all, but nothing is working.

Does anybody know how to do this?

JavaScript

Advertisement

Answer

You have spelling mistake in your View it should be “style” not “styles” like this

JavaScript

Also you can use borderRadius if you are going to use same radius on all the four corner. Here is your code with changes

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement