[iOS的材料组件] [TextFields] MDCTextField禁用状态如文档中所述不起作用

时间:2018-08-01 06:05:06

标签: ios objective-c material-design material-components material-components-ios

MDCTextField的禁用状态无法按照material design documentation

中的描述工作

我希望禁用状态的颜色应适用于占位符和边框。 enter image description here

但是结果是,我只能在禁用状态的颜色下方看到虚线。 enter image description here

是错误,还是我做错了什么?

@interface MyController ()

@property (nonatomic, strong) MDCTextInputControllerOutlined *textInputController;
@property (nonatomic, strong) MDCTextField *textField;

@end

@implementation MyController

- (void)viewDidLoad {
    [super viewDidLoad];

    self.textField = [[MDCTextField alloc] initWithFrame:CGRectMake(50.f, 50.f, 220.f, 85.f)];
    [self.view addSubview:self.textField];

    self.textInputController = [[MDCTextInputControllerOutlined alloc] initWithTextInput:self.textField];
    self.textInputController.normalColor = [UIColor purpleColor];
    self.textInputController.disabledColor = [UIColor redColor];

    self.textField.enabled = NO;
    self.textField.placeholder = @"placeholder";
    self.textField.text = @"text";
}

1 个答案:

答案 0 :(得分:0)

感谢您使用MDC-iOS。我可以确认这是一个错误。请在github上创建票证。它将被分类。您可以从那里关注该问题,甚至可以提交PR来纠正其中的一部分!