Sim*_*mon 8 iphone xcode objective-c uitextfield
在我的应用程序中,我有一个UITextField,它位于背景图像之上.在iOS 4下,我必须将backgroundColor属性设置为'clearColor'才能使其看起来正确.在iOS 4下,textfield看起来像这样......

这就是我想要的样子.现在,当我重新运行同一个项目时升级到Xcode 4.3(iOS 5),这个框看起来像这样......

哎呀.所以在iOS 5下我将backgroundColor属性更改为'whiteColor',它工作正常.但是现在,在iOS 4.x下,该框看起来像这样......

注意丑陋的白色角落!所以请,任何人都可以告诉我我应该在这里做什么,以使其在iOS 4和iOS 5下看起来正常(即看起来像第一个图像!).
非常感谢,西蒙
几天前我遇到了同样的问题。为了解决这个问题,我只需设置 borderStyle 并注释 backgroundColor 行。一切都工作正常,无论是 iOS4 还是 iOS5。
// textField.backgroundColor = [UIColor clearColor]; // just leave it, dont't set
textField.borderStyle = UITextBorderStyleRoundedRect;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2127 次 |
| 最近记录: |