简体   繁体   English

定向深色视图时出现白色边缘?

[英]White edge when orienting dark colored view?

I am just playing with an iPhone test app that orients the view when the simulator is rotated left or right. 我只是在玩一个iPhone测试应用,当模拟器向左或向右旋转时,该应用会定向视图。 Everything worked fine when my view had a white background, however when I altered the view background to a darker color I noticed a white edge (1 pixel) around the view as it rotates. 当我的视图具有白色背景时,一切工作都很好,但是当我将视图背景更改为较深的颜色时,随着旋转,我注意到视图周围有白色边缘(1像素)。 Has anyone come across this before or know how I might get rid of it. 有没有人遇到过这个问题,或者知道我怎么摆脱它。 Indeed it might be an issue with the simulator that won't show on the actual device, but I just thought it worth asking for future reference. 确实,模拟器可能没有在实际设备上显示该问题,但我认为值得将来参考。

gary 加里

I have seen something similar before.. 我以前看过类似的东西。

Go through the nib (.xib) files and make sure that all of the views have an appropriate dark background colour set, most notably the nib file which contains the "window". 浏览nib(.xib)文件,并确保所有视图都具有适当的深色背景色设置,最著名的是包含“窗口”的nib文件。 Click on them and set the background colour. 单击它们并设置背景色。

I've never noticed it but then again I've never tried to rotate a very dark view. 我从来没有注意到它,但是我再也没有尝试过旋转非常暗的视图。 There might be a small border to keep the view from visually bleeding into the status bars or other views. 可能会有一个小边框,以防止视图从视觉上渗入状态栏或其他视图。

Rotation and scaling in the discrete domain( as against analog) is quite difficult, because after a rotation/scaling the rotated location may not be a pixel location. 离散域中的旋转和缩放(相对于模拟而言)非常困难,因为在旋转/缩放后,旋转后的位置可能不是像素位置。 You can suppress the effect by smoothening the edges, but I believe that is not implemented, and so the bug. 您可以通过平滑边缘来抑制效果,但是我认为这没有实现,因此存在bug。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM