Why is uivew background black in IB xcode?

When I set the default background for the view (the view is used as the title for the table) in IB, it turns black, but when I run the application on the simulator, it has the default background color uitableview.

When I set the default color to yellow, for example, it is always yellow for both IB and the simulator.

Why is the default background color black in IB and gray with stripes in the simulator?

+4
source share
1 answer

Since there are errors in the interface builder in Xcode. I assume you mean that you are setting the background color for the default option?

I encountered several similar errors with the background color, sometimes it even sets the background color of an element that should not have a background color. Usually I make a right-click xib or storyboard file and open source. Then find my element and carefully remove the background property (make a backup copy of the file if you are concerned about accidental violation of the complex xml file structure). Then open it again as Interface Builder, and it usually highlights things.

Or, in the worst case, I delete the element of the problem or look through and recreate it.

Edit: It also occurred to me that the default color can be a clear color, in which case the texture is displayed through the view rather than being drawn as the background of the view, and the interface builder selects black because A) it doesnโ€™t know how it will look like a top view and / or B) the view or parent view is marked as opaque or something like that.

+5
source

Source: https://habr.com/ru/post/1433736/


All Articles