新的Parse UI登录视图自定义

时间:2014-11-11 12:43:02

标签: parse-platform

我正在尝试从解析UI

自定义新的日志
[self.logInView.facebookButton setTitle:@"Vpiši se z Facebook računom" forState:UIControlStateNormal];
[self.logInView.facebookButton setTitle:@"Vpiši se z Facebook računom" forState:UIControlStateHighlighted];
[self.logInView.logInButton setTitle:@"Prijavi se" forState:UIControlStateNormal];
[self.logInView.logInButton setTitle:@"Prijavi se" forState:UIControlStateHighlighted];
[self.logInView.signUpButton setTitle:@"Registracija" forState:UIControlStateNormal];
[self.logInView.signUpButton setTitle:@"Registracija" forState:UIControlStateHighlighted];

因为我相信这段代码应该更改facebookButton标签,logInButton标签和signUpButton标签。但遗憾的是,它只是改变了logInButton标签,而另外两个保持不变。我做错了吗?

感谢。

以下是整个班级:

.h文件

#import <Parse/Parse.h>
#import <ParseUI/ParseUI.h>

@interface MyLogInViewController : PFLogInViewController

@end

.m文件

#import "MyLogInViewController.h"
#import <QuartzCore/QuartzCore.h>

@interface MyLogInViewController ()
@property (nonatomic, strong) UIImageView *fieldsBackground;
@end

@implementation MyLogInViewController

@synthesize fieldsBackground;

- (void)viewDidLoad {
    [super viewDidLoad];

    //[self.logInView setBackgroundColor:[UIColor whiteColor]];
    [self.logInView setLogo:[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"PrehranaLogo"]]];

    self.logInView.usernameField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"Uporabniško ime" attributes:@{NSForegroundColorAttributeName: [UIColor blackColor]}];
self.logInView.passwordField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"Geslo" attributes:@{NSForegroundColorAttributeName: [UIColor blackColor]}];

[self.logInView.passwordForgottenButton setTitle:@"Ste pozabili geslo?" forState:UIControlStateNormal];
[self.logInView.passwordForgottenButton setTitle:@"Ste pozabili geslo?" forState:UIControlStateHighlighted];
[self.logInView.facebookButton setTitle:@"Vpiši se z Facebook računom" forState:UIControlStateNormal];
[self.logInView.facebookButton setTitle:@"Vpiši se z Facebook računom" forState:UIControlStateHighlighted];
[self.logInView.logInButton setTitle:@"Prijavi se" forState:UIControlStateNormal];
[self.logInView.logInButton setTitle:@"Prijavi se" forState:UIControlStateHighlighted];
[self.logInView.signUpButton setTitle:@"Registracija" forState:UIControlStateNormal];
[self.logInView.signUpButton setTitle:@"Registracija" forState:UIControlStateHighlighted];

}

- (void)viewDidLayoutSubviews {
    [super viewDidLayoutSubviews];
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

@end

1 个答案:

答案 0 :(得分:0)

我认为你不应该改变对象,你应该为斯洛文尼亚语添加本地化。

引用parse.com文档: 自定义字符串的最简单方法是通过iOS提供的默认本地化支持。

https://developer.apple.com/internationalization/

希望它有所帮助。