0

我已经进行了子类化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];
    }
}];
4

1 回答 1

0

发现问题,

更换

popoverMailSetupImageView.frame = CGRectMake(8, self.frame.origin.y + 65, popoverMailSetupImageView.bounds.size.width, popoverMailSetupImageView.bounds.size.height);

popoverMailSetupImageView.frame = CGRectMake(8, 65, popoverMailSetupImageView.bounds.size.width, popoverMailSetupImageView.bounds.size.height);

self.frame.origin.y不需要。

于 2013-03-07T13:14:36.540 回答