0
Я добавил UIView
, и теперь я хочу показать UILabel
. Однако он не отображается. Может кто-нибудь помочь мне, пожалуйста?Показать UILabel в UIView программно или с помощью раскадровки
- (IBAction)infoButtonClicked:(id)sender {
myView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
myView.transform = CGAffineTransformScale(CGAffineTransformIdentity, 0.001, 0.001);
UILabel *label=[[UILabel alloc] initWithFrame:CGRectMake(5, 10, self.view.frame.size.width, 100)];
[myView addSubview:label];
[self.view addSubview: myView];
[UIView animateWithDuration:0.3/1.5 animations:^{
myView.transform = CGAffineTransformScale(CGAffineTransformIdentity, 1.1, 1.1);
} completion:^(BOOL finished) {
[UIView animateWithDuration:0.3/2 animations:^{
myView.transform = CGAffineTransformScale(CGAffineTransformIdentity, 0.9, 0.9);
} completion:^(BOOL finished) {
[UIView animateWithDuration:0.3/2 animations:^{
myView.transform = CGAffineTransformIdentity;
[email protected]"The title";
}];
}];
}];
//The setup code to detect single touch
UITapGestureRecognizer *singleFingerTap =
[[UITapGestureRecognizer alloc] initWithTarget:self
action:@selector(oneTap:)];
[myView addGestureRecognizer:singleFingerTap];
}
ваше кодирование хорошо, добавить выше линии также и проверять один раз –
проверку один раз, если мой ответ хорошо, мы подгоняем что-то –
Нет он не показывает по какой-то причине. – Illep