我已经进行了子类化UIView
,基本上包含 aUIPickerView
和 a UIToolbar
。
当用户在选择器中选择特定行时,我将在选择器上添加一个UIImageView
。但是,当我动画我UIView
向上滑动屏幕时,此图像不可见。如果我不制作动画,UIView
那么它将正确显示。
我正在显示UIImageView
这样的内容(在 中UIView
):
- (void)showMailSetupPopover {
if (self.popoverMailSetupImageView == nil) {
UIImageView *popoverMailSetupImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"popover-mail-setup-addreminder"]];
popoverMailSetupImageView.alpha = 0.0;
popoverMailSetupImageView.frame = CGRectMake(8, self.frame.origin.y + 65, popoverMailSetupImageView.bounds.size.width, popoverMailSetupImageView.bounds.size.height);
self.popoverMailSetupImageView = popoverMailSetupImageView;
}
[self addSubview:self.popoverMailSetupImageView];
[UIView animateWithDuration:0.5 animations:^{
self.popoverMailSetupImageView.alpha = 1.0;
} completion:^(BOOL finished) {}];
}
这就是我添加UIView
到的方式self.view
:
RMMessageTypePickerView *messageTypePickerView = [[RMMessageTypePickerView alloc] initWithFrame:CGRectMake(0, self.view.bounds.size.height, 320, 260) reminderMessageType:RMReminderMessageTypeText delegate:self];
self.messageTypePickerView = messageTypePickerView;
[self.view addSubview:self.messageTypePickerView];
[UIView animateWithDuration:0.2 animations:^{
self.messageTypePickerView.frame = messageTypePickerViewTargetFrame;
self.addReminderTableView.frame = addReminderTableViewTargetFrame;
} completion:^(BOOL finished) {
if (firstShow) {
[self processSelectedMessageTypeRow:RMReminderMessageTypeText];
}
}];