【发布时间】:2014-06-22 15:12:03
【问题描述】:
我有一个游戏。我正在加载 3 个带有标签对象的图像视图。然后我加载 5,然后加载 7。就在昨天,我遇到了同样的问题,我找到了将标签上的自动调整大小掩码设置为无的答案。好吧,我做到了,它修复了它,但现在问题又回到了今天。这很令人困惑,我不知道如何解决它。
我的问题是,如果我已经这样做了,为什么还会发生这种情况?我该如何解决?
这是我的代码:
// random word from array of object
NSString *randomWord = [self.objects objectAtIndex:randomObject];
[self.imageViews[i] addSubview:self.labels[i]];
[self.labels[i] setCenter:[self.imageViews[i] center]];
// all labels setting text and alignment
[self.labels[i] setText:randomWord];
[self.labels[i] setTextAlignment:NSTextAlignmentCenter];
// adding words to alphabetical array
[self.alphabeticalWords addObject:randomWord];
NSLog(@"%@", randomWord);
//NSLog(@"%@", self.alphabeticalWords);
[self.labels[i] sizeToFit];
[self.labels[i] setAutoresizingMask:UIViewAutoresizingNone];
[self.imageViews[i] setUserInteractionEnabled:YES];
[self.imageViews[i] addGestureRecognizer:panGesture];
问题来了
非常感谢任何帮助。
【问题讨论】:
标签: ios objective-c uiimageview uilabel