我在覆盖 PFLoginView 中的 parse.com 元素时遇到一些困难。 除了用户名和密码 UITextfields 之外,一切都很好。 我已经删除了大部分“库存”显示,但我似乎无法摆脱该字段的顶部和底部栏(参见屏幕截图)
我几乎什么都试过了。
这是我的 viewDidLayoutSubviews 方法中的代码。
[self.logInView.usernameField setBackground:nil];
[self.logInView.usernameField setBackgroundColor:[UIColor clearColor]];
[self.logInView.usernameField setPlaceholder:@""];
[self.logInView.usernameField setBorderStyle:UITextBorderStyleNone];
我基本上希望整个字段为空,我使用 uiimageview 作为字段背景,您在带有图标的屏幕截图中看到。图标和灰色条是我的,白色条我不知道如何删除。
任何提示都很好,我似乎无法删除它们。
最佳答案
最新版本的 Parse SDK 中的登录屏幕使用自定义 PFTextField 子类,它负责绘制您在此处看到的边框。用于边框的常用 UITextField 方法都不会更改样式或使它消失。
要完全删除边框,您可以在 viewDidLoad
方法中设置分隔符样式,如下所示:
[self.logInView.usernameField setValue:[NSNumber numberWithInt:0] forKey:@"separatorStyle"];
[self.logInView.passwordField setValue:[NSNumber numberWithInt:0] forKey:@"separatorStyle"];
关于ios - Parse.com PFLoginView UITextfield 显示问题。不能删除边框?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27648499/