uchicago-mobi / MPCS51030-2017-Winter-Forum

7 stars 0 forks source link

Image doesn't show up on the board #93

Closed hsuanhsuantsai closed 7 years ago

hsuanhsuantsai commented 7 years ago

Hi,

After I drag my cross/nought onto the board, the image doesn't show up in the grid but disappears. I've already added the image view as a subview of the grid UIView. Also tried to bring the image view to the topmost subview but nothing changed.

Could someone help me deal with it?

Thanks.

hbennett766 commented 7 years ago

I'll download your project and take a look.

hbennett766 commented 7 years ago

Check out issue #90 to see how to debug your view hierarchy, and you'll see that the views are showing up on the screen. The size and location of the subviews looks to be the issue. Double check your math on how you're calculating the placement, and consider explicitly setting the frame of the subview to be equal to the tagged superview.

A second idea, but would require more rework, would be to make the tagged views on storyboard UIImageViews, and assign the image property to be the X or O, instead of trying to add UIImageView subviews to UIViews.

hsuanhsuantsai commented 7 years ago

Thank you.